Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Comparing dates in Jira Automation

I have two date fields - Target Date and Due Date. I want to create an automation so that any issues where Due Date is after Target Date are flagged into a custom field.

Based upon some previous community posts, I've been testing out isAfter and date diff with smart values, using advanced compare, but haven't been successful yet.

Using advanced compare in Automation, I've used

{{issue.Due Date.isAfter(issue.Target End)}} 

equals

true

However, I haven't been able to get this comparison to return true yet.

Any suggestions?

2 answers

On this page

https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/

I found that the Due Date field is referenced using this

issue.duedate

 

Have you tried another date function, like

{{[date1].dif([date2]).[unit]}}

 

to confirm that the system can calculate that there is a difference between the dates?

0 votes
John Funk Community Leader Jul 04, 2021

Hi Jon,

What I would do is create a custom number field where the difference between the two dates are stored. Then you can run a filter where that value is check to be greater than zero (or another number if you like.

So it would be a rule based on one of the fields being updated. 

Then have a new action for Edit issue and select the new number custom field. 

In the Set value area put in something like: {{issue.Due Date.diff(issue.Target Date).days}}

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Trello

🏊‍♀️ Atlympic Event: Trello

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

124 views 1 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you