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 ) {{/}}
Bit of a noob to the automation piece of Jira.
Thanks for any direction you can send me.
David
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!!!!
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:
This would give you this:
However, since your question was around Start Date, Now and Due Date, changing created to Start Date gives:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks.. good catch.
I updated to that and ran the rule and it doesn't provide any result.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good to see you got it working
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.