Forums

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

'Diff' does not work for specific dates for a given Jira ticket

Bryan Kim
Contributor
September 16, 2024

Hi all,

 

I am trying to determine duration of a given ticket in a specific status. To achieve that, an automation is set up to retrieve two dates: 'now' and 'statuscategorychangedate'. 

For some reason, calling 'diff' for these two dates simply yields nothing. But it seems to work with 'updated', although that's not something what I'm looking for.

  • {{updated.diff(now).days}} works.
  • {{statuscategorychangedate.diff(now).days}} doesn't work.

I checked values and 'statuscategorydate' does seem to have a same data format as 'now'.

 

I would be grateful if someone could share some insights on this, thanks in advance!

2 answers

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 Leaders.
September 16, 2024

Hi @Bryan Kim 

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!

Until we see those...

What version of Jira are you using: Cloud, Server, or Data Center?

And for Jira Cloud, the field statuscategorychangedate is returned as text to rules and only returns the change for the status category values (i.e., To Do, In Progress, and Done).  It does not record the value for all status value changes.

Kind regards,
Bill

0 votes
pinky_reddy
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 Leaders.
September 16, 2024

Hi @Bryan Kim 

Welcome to the community

Looks like you have the similar issue as discussed in this question. 

https://community.atlassian.com/t5/Jira-questions/Automation-some-dates-are-not-handled-as-dates/qaq-p/1534402

It might look like this {{issue.statuscategorychangedate.toDate().diff(now).days}}

Give it a try and let me know how it went.

Bryan Kim
Contributor
September 16, 2024

Hi @pinky_reddy,

I tried the following, and it seems to work. :) I think the value itself is not correct at the moment, but it is a starting point at least.

{{statuscategorychangedate.toDate().diff(now).days}}

 

Thank you!

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