On this page



Use case

Set a date on a given day of the week every two weeks. An example would be setting an appointment on the second and fourth Thursday of the month skipping the first and the third Thursday.


Configuration


Add the Update or copy field values post function to the transition of your choice.


Target issue

Choose Current issue


Fields


Field

Choose a Date Picker field, as for instance the Due date field.


Value

Choose Set field value manually


Expression

modulus(weekOfTheYear({00057}, {MONDAY}, 7, LOCAL),2)=0 ? 
nextDayOfTheWeek(datePart({00057}, LOCAL), {THURSDAY}, LOCAL) : 	
addDays(nextDayOfTheWeek(datePart({00057}, LOCAL), {THURSDAY}, LOCAL), 7, LOCAL) 

The next appointment will be set next Thursday if the week of the month is even and a week later if it is uneven.

If you need to set the appointment on another day of the week, change {THURSDAY} for the field code corresponding to the day of the week of your choice.

If you need to change the order of the weeks in which the appointment is set (even and uneven weeks), change the number 0 in the expression for 1.






Related use cases




JWT feature

Workflow function

Update or copy field values

Parser functionsaddDays() nextDayOfTheWeek() modulus() weekOfTheYear() datePart()
Labelused to mark a use case as staff pick





Status
Tech review

Style guide