How to calculate the value of a custom field based on values selected from two dropdowns?

Jemima James June 22, 2022

I have two dropdown fields, both of which is a list: 1,2,3,4,5.

Dropdown field names are:

  1. Sample impact (1-5)
  2. Sample probability (1-5)

What I want is to set the value for the field: Sample Factor (number field) based on changes in value of either of the above fields. Logic for it is: Sample Factor = Sample Impact (1-5) * Sample Probability (1 -5)

How do I achieve this using jira automation smart values?

I have tried the below expressions:

  • {{#=}}{{issue.Sample probability (1-5).value}} * {{issue.Sample impact (1-5).value}}{{/}}
  • {{#=}}{{issue.fields.Sample probability (1-5).value}} * {{issue.fields.Sample impact (1-5).value}}{{/}}

Sample Factor value gets updated on the issue but automation audit log shows the below error:

  • Error rendering smart-values when executing this rule: Failed to get value for issue.Sample probability (1-5).value: {{#=}}{{issue.Sample probability (1-5).value}} * {{issue.Sample impact (1-5).value}}{{/}}

 

I also tried using custom field id:

  • {{#=}}{{issue.fields.customField_idxxx).value}} * {{issue.fields.customField_idxxx.value}}{{/}}
For which i go the error: 
  • Failed to get value for issue.fields.Sample_impact_(1-5).value: {{#=}}{{issue.fields.customField_idxxx}} *{{issue.fields.customField_idyyy.value}}{{/}}

1 answer

1 accepted

3 votes
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 22, 2022

Hi Jemima - Welcome to the Atlassian Community!

You shouldn't need the word "value" anywhere in your smart values code. 

So try this: 

  • {{#=}}{{issue.Sample probability (1-5)}} * {{issue.Sample impact (1-5)}}{{/}}

Or

  • {{#=}}{{issue.customfield_xxxx}} * {{issue.customfield_xxxx}}{{/}}
Jemima James June 22, 2022

Thank you so much!

  • {{#=}}{{issue.customfield_xxxx}} * {{issue.customfield_xxxx}}{{/}}

This worked for me while the other resulted in the same error as before.

Suggest an answer

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

Atlassian Community Events