Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,367,227
Community Members
 
Community Events
168
Community Groups

Set due date on subtask according to the day of the week

I would like to, once a task is created, automatically create a subtask with due date as two Fridays before the due date of the task.

I tried by using:

{{issue.duedate.withNextDayOfWeek("FRI").minusDays(14)}}

 

However, if the task is on 

Since if the due date is on Friday this might not work, I tried by using If/else but it doesn't seems working. 

Any clues on how can I make it please?

2 answers

1 vote
Alex Koxaras Community Leader Sep 23, 2022

Hi @Beatriz Rodriguez Sanz and welcome to the community,

You missed a space on your smart value:

{{issue.due date.withNextDayOfWeek("FRI").minusDays(14)}}
0 votes

Hi @Beatriz Rodriguez Sanz -- Welcome to the Atlassian Community!

To confirm your use case, are you saying that...you always want the sub-task to have a due date of the Friday that is two weeks ago?

If so, would you please post an image of your rule with the if/else structure?  That may reveal what is happening as the function withNextDayOfWeek() works differently when on the tested day (i.e. Friday)...

Sets the date to the next matching day. If you're already on that day, then it will return the next week. You can use the following values: MON, TUE, WED, THU, FRI, SAT, SUN.

And so your if/else would need different numbers for minusDays()

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events