To create a new custom field calculated, we can use the addon of JIRA “JIRA Misc Custom Fields”. The plugin can be downloaded from: https://marketplace.atlassian.com/plugins/com.innovalog.jmcf.jira-misc-custom-fields/server/overview
Example of Custom Field that sum two different Custom Fields:
1.- Go to create new Custom Field. Select Type “Calculated Number Field”
2.- In the “description” of the new customfield set a formula like this:
<!– @@Formula:(issue.get(“customfield_12703”) != null ? issue.get(“customfield_12703”) : 0)+(issue.get(“customfield_12704”) != null ? issue.get(“customfield_12704”) : 0)
–>
Is there a way to refer to the fields with their actual names instead of customfield_12703. Because when we do a backup and restore from our prod environment, like to refresh our dev or stage environment, those custom field numbers are different. So it’s always a manual adjustment we need to make.
LikeLiked by 1 person
In the case of a custom field, has the form customfield_xxxxx, where xxxxx is the custom field numerical ID, as seen in the URL when editing the field. Or, starting with JIRA Misc Custom Fields v1.6.2 or JIRA Misc Workflow Extensions v. 3.7.0, you can also use the “real name” of the custom field (as shown in the list of custom fields).
https://innovalog.atlassian.net/wiki/display/KB/Using+issue.get(%3Cfield_name%3E)+in+scripts
LikeLiked by 1 person
this is not a good formula.
convert it to int and then math
LikeLike