Good day!
I want an automation to write the amount of days since the creation of the issue and today.
I am using Jira Product Discovery. technically I will run the automation once a day and update the age field.
I know now how to add days to a date, but I don't know how I could calculate the difference between.
I believe I need to use the {{createdIssue.created}} and now.jiraDate parameters.
Any idea?
I cannot use a marketplace app to do so.
Hello @Martin
I don't use Produc Discovery but in Jira Software, i using this smart value :{{issue.created.diff(now).days}}
Hope this can be use on JPD
Hi @Martin ,
I'm prettyr sure you can't use the formula in the JPD field. But you can create a field called 'Age' and update this once a day via automatoin like @Duc Thang TRAN said.
I would recommend to only do this for issues that have not been resolved, so set a JQL on the scheduled trigger.
Cheers,
Rudy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi guy,
this is a good trail. I ran it but the numbers were negatives, but accurate. I tweeked it to this:
{
"fields": {
"customfield_10842": "{{#=}}{{now.diff(issue.created).days}} * -1{{/}}"
}
}
Thank you all!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Martin
That's why I reversed the fields {{issue.created.diff(now).days}} to get a positive number of days. But your way works as well, and I'm glad it helped you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ho! I didn't see that detail. I'll add this to my knowledge book.
Thank you @Duc Thang TRAN
Do you have a reference on those expressions and variables?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Duc Thang TRAN do you think this is good automation. this is how we have to set ? if this is wrong or over complexed. please can you give me the picture of the autmation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Martin
Here you can find all smart value https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/
Hello @Luqman Jamil
I think you can make it simpler.
In scheduled, you can use JQL and give status != done
(uncheck "Only include issues that have changed since the last time this rule executed").
Then edit the issue field. You don't need a branch or field condition again because this is already filtered by JQL in the schedule.
Best :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Duc Thang TRAN Now I am using the same thing which you guided me to set up automation, but I am getting the aging as 2 not 3. Do you know why?
The automation Rule is set up as bellow :
When scheduled is using JQL Query as status != Done and Only include issues that have changed since the last time this rule executed is UNCHECKED.
in the Edit Issue. using the Aging field and {{issue.created.diff(now).days}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Luqman Jamil
I think that with the configuration of Jira , Jira tries to round the result up, and automation rounds it down. If you want to see the real result, you can try this way
{{#=}}{{issue.created.diff(now).hours}} / 24 {{/}}
Best :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.
Learn more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.