Forums

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

Jira automation & issue list & date.diff

Tomas Slavkovsky
Contributor
February 2, 2023

Hi, 

I am trying to create Jira automation to send an email with a list of issues, including the number of days since the last update. I receive the email correctly, but the diff calculation does not work for all issues in the list. It returns the value correctly only for the first item, which is 100 days in my example. Then the value is copied to other items in the list. 

Any idea how to fix this?

The automation looks like this: Screenshot 2023-02-02 at 16.45.56.png

Email which I get:

Screenshot 2023-02-02 at 16.46.17.png

1 answer

1 accepted

2 votes
Answer accepted
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.
February 2, 2023

Hi @Tomas Slavkovsky 

Interesting...as I believe you have discovered one (and possibly two) defects...

First automation defect: date diff() does not appear to work correctly using the smart value order you have tried, even though the documentation shows that should work.  If you invert the order it will work as you expect.  This symptom could also be related to known problems where many smart values do not work as parameters to functions for list iterators.

{{#lookupIssues}}
{{updated.diff(now).days}}
{{/}}

 

Does your scheduled trigger have JQL?  If it does not, this rule should fail because the condition is testing the {{now.diff(issue.updated).businessDays}} and there is no issue to test.  That would be another defect to submit to Atlassian.

If instead your trigger does have JQL, I am unclear of the purpose of your condition.  Is there one specific issue the rule uses to test the business days difference, or are you trying to do something else?  Please explain the purpose of that condition test.

 

As you appear to be on a paid Jira license, I recommend working with your site admin to submit both of these as defects here: https://support.atlassian.com/contact/#/

 

Kind regards,
Bill

Tomas Slavkovsky
Contributor
February 2, 2023

Bill, thank you, appreciate your time. I tried to invert the order, and it's working.


Regarding the condition, the purpose was to send a list of issues which are older than x days. The condition was triggering the email, and I haven't been thinking about it yet. Probably, I will change my JQL to include this condition to avoid the if condition in automation. This should do the trick.

Kind regards

Tomas

Like Bill Sheboy likes 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 Leaders.
February 4, 2023

I am glad to learn that helped.

If you are unable to add your condition using JQL, it may be possible to also add it using smart value, list filtering: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588

Igor Fortunato
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 16, 2024

Worked also for me, thanks @Bill Sheboy !

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events