Hello, I need some help as I am a groovy/beanshell newb!
I am trying to take the highest value of 3 number fields (risk1, risk2, risk3) and multiply that by a fourth number field (probability) to set a 5th value (residual risk rating). Can anyone steer me in the right direction, maybe give some example code? I've looked around on this tag and have not seen anything similiar! Any help would be greatly appreciated.
You can create a Calculated Number Field, and in the description of that field (Field->Edit), type something like:
<!-- @@Formula: if (issue.get("<field4>")==null) return null; Double m = 0; if (issue.get("<field1>") != null && issue.get("<field1>") > m) m = issue.get("<field1>") ; if (issue.get("<field2>") != null && issue.get("<field2>") > m) m = issue.get("<field2>") ; if (issue.get("<field3>") != null && issue.get("<field3>") > m) m = issue.get("<field3>") ; return m * issue.get("<field4>"); -->
where <field1> ... <field4> are the names of the four Number fields. Note that:
1) these fields must be Number fields - not text fields containing a number (otherwise some conversion is required)
2) the sample code above returns null if any of the fields is null - you might want a different strategy, such as ignoring empty fields 1 to 3.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs