Forums

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

Help needed for using date subtraction in an automation

Jaqueline Mendes June 20, 2023

Hello guys,
I need help with an automation task. In my workflow, I use epics, and I need to track changes in the due date. Whenever there is a modification in the due date of a card, I need to retrieve the previous date and calculate the difference between the previous date and the new date. For example, if the date on the card was 06/22/2023, and I changed it to 08/22/2023, I would like to identify the difference, which in this case is 2 months. Is there a way to accomplish this automation without adding plugins?
I appreciate any assistance you can provide. Thank you in advance.

 

Important: I have managed to save the previous date and the new date in a variable using automation, but I am having difficulty in calculating the difference between these dates. I have tried some functions, but I have not been successful.

1 answer

1 vote
Ojase Emmanuval
Community Champion
June 20, 2023

I have used the following smartvalue to calculate the difference between created date and due date.

{{issue.created.diff(issue.duedate).days}}

You can use something similar. When you copy the old and new values to variable, please make sure you are parsing the value as date and not string. 

Suggest an answer

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

Atlassian Community Events