Hi all, I am trying to set up recurring tasks within Jira to manage our team calendar and reports that we produce.
I am trying to clone a task when it is marked as "done" and depending on what we have set the frequency as, I want it to perform different actions.
- If the frequency is "daily" I want it to clone the task to the following day
- If the frequency is "weekly" I want it to clone the task to the same day next week
- If the frequency is "monthly" I want it to clone to the same date next month however, if that date falls on a weekend then I want it to set the due date to the Monday after the weekend
- If the frequency is "quarterly" I want it to clone to the same date in 3 months time however, if that date falls on a weekend then I want it to set the due date to the Monday after the weekend
The "daily" and "weekly" automations that I have set up are working okay but the monthly and quarterly ones keep failing. The audit logs say "failed to get the value"
The code I have been inputting for the monthly task clone which keeps failing is:
{{now.plusMonths(1).withDay(now.dayOfMonth).plusDays( if(now.plusMonths(1).withDay(now.dayOfMonth).format("E") == "Sat", 2, if(now.plusMonths(1).withDay(now.dayOfMonth).format("E") == "Sun", 1, 0)) ).jiraDate}}
The code I have been inputting for the quarterly task clone which keeps failing is:
{{now.plusMonths(3).startOfMonth.plusDays(now.format("d").minus(1)) .plusDays( if(equals(now.plusMonths(3).startOfMonth.plusDays(now.format("d").minus(1)).format("e"), 6), 2, if(equals(now.plusMonths(3).startOfMonth.plusDays(now.format("d").minus(1)).format("e"), 7), 1, 0)) )}}