Custom field 1 = 'Likelihood'
Custom field 1 single choice option = 1, 2, 3, 4, 5
Custom field 2 = 'Consequence'
Custom field 2 single choice option = 1, 2, 3, 4, 5
Custom field 3 = 'Overall Risk Score'
Custom field 3 is a calculated field (read only) and must calculated by field 1 x field 2
I dont see where you insert the calculation in the calculated field config?
I cant find any clear directives and I am not a programmer, but do have full JIRA admin access and experience in setting up JIRA, simply looking for calculated field direction
We have the custom misc fields add on already, so Im setup and ready to go assuming this is enough.
Thanks!
More searching found this page: https://innovalog.atlassian.net/wiki/spaces/JMCF/overview#JIRAMiscCustomFields-calculatednumberfield
Working on it..
Yes, that's the correct documentation. Let me know if you're having difficulties.
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David, finally got back to this.
I literally copy and pasted and updated the ref formula:
To add two custom fields, such as "Business Value" (or in my case Liklihood) and "Technical Value" (or in my case Consequence) to get an "Overall Value":
<!-- @@Formula: (issue.get("customfield_11001") != null ? issue.get("customfield_11001") : 0) + (issue.get("customfield_11000") != null ? issue.get("customfield_11000") : 0) -->
Now the next bit is weird, when I put field A as 2 and field B as 3, instead of addition, it concatenates together, Ie shows as 23, not 5
I have confirmed that this isnt a fluke either, change the entry fields, the output fields are concatenated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I thought it may be due to the fields types which are being used.
Both fields are 'Select list, single choice' fields where I simply list out 1, 2, 3, 4, 5 as the drop down options
Is it possible that JIRA is treating these as 'labels / words' rather than numbers?
That would explain the concatenation
I wanted the user to choose from limited set to ensure correct expected calculation, what would be a better custom field type to use?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For Single-select list custom fields, issue.get returns a String representing the selected value (since the value can be any text, not necessarily numbers). So you need to convert the value to a number. Try this:
<!-- @@Formula: (issue.get("customfield_11001") != null ? Integer.parseInt(issue.get("customfield_11001")) : 0) + (issue.get("customfield_11000") != null ? Integer.parseInt(issue.get("customfield_11000")) : 0) -->
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.