I have these fields with numerical values:
I would like to auto-populate another field named Percent Completed by dividing Total Resolved Points by Total Points then multiplying by 100. Can you tell me what type of field to create to house this and how to populate it with a formula to show the Percent Complete? I have ScriptRunner but no other plug-in. I am not a developer and cannot code, so really need help.
You can create an automation rule and have an edit action the looks like:
{{#=}}{{issue.Total Resolved Points}} / {{issue.Total Points}} * 100{{/}}
Okay, this (above) worked for my Epic % Complete field. Thank you! Here's my next problem, however:
This automation runs when a story is updated. When the story is updated to add an Epic Link, the story points from it are added to the field Total Points field on the Epic screen for the Epic it is linked to). This works great, except in the circumstances when someone changes the Epic Link on the Story or deletes the Epic Link from the Story. When that happens, the Lookup issues portion of the Automation no longer can find the Epic the story was assigned to (since it changed) so the story point total in the Epic remains at the same number even though the story is no longer linked to it.
I can fix this by going into one of the stories that is still assigned to the Epic and making any kind of update to the form, which triggers the rule and point calculation again. But when I try to automate this (add then remove a label to every story, for instance, via automation), the update to the issue doesn't trigger the rule calculation. Why does an automated update not work, but a manual update does? Any ideas on what I can do?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To clarify, I want to force an update to stories with Epic Links via Automation, but when I do things like add a Label or add a Comment to the story via Automation, that does not kick off the Automation pictured above. I don't understand why! If I make the same change manually to the story with the Epic Link, the Automation above kicks off.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check the option:
"Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule"
This option can be found in the rule details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
THANK YOU!!!!!!! I can't believe how much time I wasted. You're wonderful!!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Marc - Devoteam I'm hoping you can help me. My automation using
{{#=}}{{issue.Total Resolved Points}} / {{issue.Total Points}} * 100{{/}} works in some cases, then does not. I'm getting this in the Audit log when it does not (see screen cap). Any ideas? What is strange is that it sometimes works (see second screen cap).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This will occur when you have the incorrect smart value for the field, as it becomes an empty/null value in the expression.
So if the field has no value, this can occur.
You could set your calculation like this:
{{#=}}{{issue.Total Resolved Points|1}} / {{issue.Total Points|1}} * 100{{/}}
The the field always has 1 as default in the calculation, if the field is empty in an issue. When performing the automation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are correct again! My Automation to calculate the Total Resolved Points was entered in a way that after the result was calculated I set the automation to clear the field mistakenly! I just had to fix that and it all appears to be working now. You're so wonderful!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Kathy Dickason
In your post tags you have indicated both Data Center and Server. Which are you actually using, and what version?
Are you going to want to use that Percent Complete field within Filters?
As alluded to by the reference @Nicolas Grossi provided, Automation for Jira could be used to accomplish this. However, the functionality available differs based on the product you are using and the version of the product. Here is the home page for the latest documentation of the Automation feature in Jira Data Center.
https://confluence.atlassian.com/automation/
Jira Server/Data Center does not natively offer scripted or calculated fields, so Automation is a native method for accomplishing your requirement. You can also use the field in Filters if you populate it with this method.
Not all users can create Automation Rules. You may need to get help from your Project Administrator or Jira Administrators to get the rule created.
You said you have ScriptRunner. You could alternately use a Script Field for Percent Complete.
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.
I would need to know what to type in the Script Field... Unfortunately, I'm not a software engineer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kathy Dickason you might review the following thread:https://community.atlassian.com/t5/Jira-questions/Calculate-sum-of-values-of-2-custom-fields-in-other-custom-field/qaq-p/726417
Nicolas
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.