Forums

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

How do I get my automated due date to be next week on a certain day of the week?

Ganea_ Merissa
May 15, 2026

I have an automation where I am trying to run the automation this week, but I want the created story to have a start date of next week's Wednesday and a due date of next week's Friday. Here is what I am using:

Start Date (this is a custom field): 

     {{now.withDayOfWeek(3).plusWeeks(1)}}

Due Date: 

     {{now.withDayOfWeek(4).plusWeeks(1)}}

 

I have also tried {{now.plusWeeks(1).withDayOfWeek(4).jiraDate}} and each time the start and due date get returned empty.

Any suggestions are appreciated!:)

 

 

2 answers

2 votes
Trudy Claspill
Community Champion
May 15, 2026

Hello @Ganea_ Merissa 

I don't have an answer for you yet on the correct way to do this, but I can tell you why it isn't working as you currently have it.

According to the documentation there is no such function as withDayOfWeek().

EDIT: I was wrong. The function does exist.

Trudy Claspill
Community Champion
May 15, 2026

I must retract my last statement. I found it buried in the documentation:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-with-attribute---

Like Marc -Devoteam- likes this
Trudy Claspill
Community Champion
May 15, 2026

I came up with a solution. It may not be the only solution.

You can use two IF/ELSE blocks to assess what the current day of the week is and from that get the date for the specified day of the week in the next week.

This smart value returns the number for the current day of the week:

{{now.format("e")}}

In my system the week is set to start on Sunday, and the numbers associated with the days of the week are 1 through 7.

The logic for getting the date for Wednesday of next week is then:

If the current day of the week is Weds or later
Then get the date of the next Weds
Else
Add one week to the current date, and then change that date to the Wednesday of that week.

In my example I am using just a Log action to print the results to the rule execution Audit log.

Screenshot 2026-05-15 at 9.56.21 AM.png

You would use a similar IF/ELSE block to get the date for the Friday of next week.

Screenshot 2026-05-15 at 9.57.44 AM.png

 

The tricky part is how to incorporate this into your current automation. And the answer depends on the structure of your current automation. 

Is you automation creating the Story that you want to change, or is it triggered by the creation or or a change to the Story you want to change?

Can you provide a screen image showing your entire current automation rule?

Like Arkadiusz Wroblewski likes this
Trudy Claspill
Community Champion
May 15, 2026

@Ganea_ Merissa 

I have the correct syntax for embedding this within a field.

Using Wednesday as the example day of week:

{{if(now.format("e").asNumber.gt(3), now.withNextDayOfWeek("WED"), now.plusWeeks(1).withNextDayOfWeek("WED"))}}

You can use this in a Create action. I used it in an Edit action.

Screenshot 2026-05-15 at 3.23.31 PM.png

Like # people like this
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.
May 15, 2026

Hi @Trudy Claspill 

I recommend adding .jiraDate to the end of each expression to ensure the time component of the value does not cause problems with the Due Date field.  I have both observed and read questions where that can intermittently cause problems for date-only fields versus date / time ones.

Kind regards,
Bill

Like # people like this
Trudy Claspill
Community Champion
May 15, 2026

Thank you @Bill Sheboy 

I just published an article on this solution. I welcome this and any other feedback that you would like to share.

https://community.atlassian.com/forums/Jira-articles/Automation-Set-date-field-to-a-day-of-week-in-a-future-week/ba-p/3235816

Like # people like this
Trudy Claspill
Community Champion
May 18, 2026

With @Bill Sheboy suggestion the final syntax is:

{{if(now.format("e").asNumber.gt(3), now.withNextDayOfWeek("WED").jiraDate, now.plusWeeks(1).withNextDayOfWeek("WED").jiraDate)}}

 

Like Bill Sheboy likes this
0 votes
Arkadiusz Wroblewski
Community Champion
May 15, 2026

Hello @Ganea_ Merissa 

Could you please share a screenshot of the full automation, ensuring any sensitive data is hidden? Even seemingly small detail can lead to Failure. Before that it will be hard for us to Doctor 💊 your Automation. 

Ganea_ Merissa
May 15, 2026

 

I used the below workaround, but my fear is if automation ever fails and the fix doesn't happen until the next day, then all of my dates will be wrong. I really want to be able to specify the next week's day of the week for both the start and due date. This pertains to accounting information and any wrong date could mean a payroll delay.

 

{{now.plusDays(5)}} to get Monday{{now.plusDays(7)}} to get Wednesday

Screenshot 2026-05-15 122305.png

Trudy Claspill
Community Champion
May 15, 2026

Hello @Ganea_ Merissa 

What you showed doesn't match your original requirement:

start date of next week's Wednesday and
a due date of next week's Friday.

With your rule scheduled to run on Wednesday your start date current is set to
Weds + 5 days = next Monday 

And your due date currently is set to
Weds + 7 days = next Weds.

 

Also what do you mean exactly by "if it fails and doesn't get fixed until the next day"? Do you meany you would manually run the rule on a different day of the week than the scheduled run on Weds?

Ganea_ Merissa
May 15, 2026

There are two automations...the other one would use this for both the due date and the start date: {{now.plusDays(9)}} to get a due and start date of Friday.

What I mean by if it fails and doesn't get fixed until the next day is this: If Jira automations fail due to an outage and the fix doesn't get implemented until Thursday, sometimes Atlassian runs all failed automations that happened during that time. If they did that, then the start and due date would get pushed out by a day...no longer landing on the Friday it was due, because it is counting out days from the date the automation got run instead of specifying the actual day of the week to be due. 

Trudy Claspill
Community Champion
May 15, 2026

The method I proposed in my answer would set the dates correctly regardless of which day of the week the automation runs.

But my method is not able to be used directly within the fields. 

What is the configuration of your Scheduled trigger? Does it include a JQL such that multiple Stories end up getting created each time it runs? Or is the intention to create just a single story each time it runs?

Ganea_ Merissa
May 15, 2026

multiple stories get created each time it runs, and each story could have a variation of two start and due dates: Monday to Wednesday, or Friday to Friday. For this one automation formula, 200+ stories rely on it to have accurate dates. I need the jql to be within the fields.   

I have a separate automation that then checks the start and due dates after they have been populated to ensure they do not fall on a company holiday. If they do, then the separate automation would move the dates to the preceding business day.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events