Forums

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

How can I set DueDate to endof day + "X" business days? instead of using the now."..."

Michael Smith March 9, 2023

I have automation that sets the due date for an issue based on its issue type at the time it moves to "In Progress" ( {{now.plusBusinessDays(5)}}). I then have an automation that compares the resolution date to the due date and puts a "past due" label on the issue when it transitions to done if the due date is less than the resolution date. 

The problem is based on time stamps some issues are being labeled as "past due" because they were moved to "In Progress" in the morning but resolved in the afternoon of the due date.

This of course creates manual intervention defeating the intended purpose of these automations.

1 answer

2 votes
Mikael Sandberg
Community Champion
March 9, 2023

Hi @Michael Smith,

Welcome to Atlassian Community!

You could manipulate the two dates to see if there is a difference based on number of days, like this:

{{issue.due.diff(issue.resolved).days}}

Michael Smith March 9, 2023

@Mikael Sandberg Thank you for quickly offering a solution, I apologize for my ignorance but I want to make sure I understand how this is working.

It appears that it is performing a comparison of the dates but telling it to ignore the time stamp. Doesn't this mean I would need to "print" that value somewhere and then check if the value is greater than 0 label that issue past due?

Mikael Sandberg
Community Champion
March 9, 2023

Correct, the diff ignores that time and will only return the diff in days. And no, you would not need to "print" the diff, you can use it as is in an advanced compare if condition like this:

Screenshot 2023-03-09 at 3.01.30 PM.png

The rule will not go past this compare unless the compare is true.

Like # people like this
Michael Smith March 9, 2023

Thank you so much for the explanation! This will work great I have no doubt.

Like # people like this

Suggest an answer

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

Atlassian Community Events