Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Beatriz Rodriguez Sanz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 23, 2022

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 -Relational-
Community Champion
September 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
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 23, 2022

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
Product Admin
TAGS
AUG Leaders

Atlassian Community Events