Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate the average of three dropdown values and display the result?

Prabhav Mhapne
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 14, 2023

How can I calculate the average of three dropdown values ranging from 1-5 and display the result in another dropdown or output field?

Here is an example of 3 criteria (Item A, B & C), each ranging from 1 to 5. The user will define the 3 criteria, and the relevance score will automatically calculate the average of the 3 criteria to output the result. (round off to the nearest whole number)

Is there a simple way to take an average and output the action on JIRA?

 

Bildschirmfoto 2023-12-14 um 16.23.53.png

Thanking you in advance for your support!

Prabhav

1 answer

1 accepted

0 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 14, 2023

Hi @Prabhav Mhapne -- Welcome to the Atlassian Community!

You could do that with an automation rule or with a marketplace addon for scripting if you have that.

To do this with automation rules, you may want 2 rules: one triggered on issue create and another triggered if any of the 4 fields change (the inputs or if someone manually overrides your average value), and then use the math functions to calculate the result: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

For example:

{{#=}} ROUND( ( {{issue.ItemA.value|0}}+{{issue.ItemB.value|0}}+{{issue.ItemC.value|0}} ) / 3, 0) {{/}}

One key thing is to confirm you have the correct smart values for your fields.  This how-to article can help with that: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

 

To get you started on creating your rule, please refer to these documentation and example sources:

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events