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

Help with Automation in Jira

Dahveede Mahthighass June 11, 2024

Hi all, 
I'm trying to set up automation to enter a value in a custom field I've added and I'm stuck. 

I'm trying to get the Percentage complete based on the StartDate, Now, and the DueDate.

I know I can manually get the right percentage of work completed (today's date - start date) / (due date - start date).

I can't quite figure out the Jira query to use to provide that value.

{{#=}} ( ({{now.diff(issue.StartDate).days}}) / ({{issue.dueDate.diff(issue.createdDate).days}} + 0.0001) * 100 ) {{/}}


image.png

 

Bit of a noob to the automation piece of Jira. 

Thanks for any direction you can send me. 

David

2 answers

2 accepted

0 votes
Answer accepted
Dahveede Mahthighass June 12, 2024

So here's how I resolved it and got it working. 

Round({{#=}}( ({{issue.customfield_10843.startOfDay.diff(now.startOfDay).days}} / {{issue.customfield_10843.startOfDay.diff(issue.duedate.startOfDay).days}}) + 0.0001) * 100 {{/}}, 0)

Corrected my Created date mistake. I copied the wrong line from my notepad. :)
Start date was a custom field, so I pulled in the field name.

This all works now to give me an aging percentage on a story. 

Thanks Stephen for making me think more... much appreciated!!!!

0 votes
Answer accepted
Stephen_Lugton
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2024

@Dahveede Mahthighass 

You've asked about how to calculate Percentage complete based on the StartDate, Now, and the DueDate, but you appear to have used 'createdDate' in your calculation.

The changes you need to make are:

  • StartDate -> "Start date"
  • createdDate -> created

This would give you this:

  • {{#=}} ( ({{now.diff(issue."Start date").days}}) / ({{issue.dueDate.diff(issue.created).days}} + 0.0001) * 100 ) {{/}}

 


 

However, since your question was around Start Date, Now and Due Date, changing created to Start Date gives:

  • {{#=}} ( ({{now.diff(issue."Start date").days}}) / ({{issue.dueDate.diff(issue."Start date").days}} + 0.0001) * 100 ) {{/}}
Dahveede Mahthighass June 12, 2024

Thanks.. good catch. 
I updated to that and ran the rule and it doesn't provide any result. 

Stephen_Lugton
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 13, 2024

Good to see you got it working

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events