Forums

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

Need help to multiply value of 2 custom fields in Automation Smart Values for Team Managed Project

gowri.kumar February 9, 2022

Hi,

I have a Team managed project in JIRA. It has 2 list type custom fields - Impact and Probability, which have numbers in the dropdown.

I would like to multiply the selected value of the 2 custom fields and save them in another field (Score)

Score = Impact * Probabilty

However, I am unable to make this work using Automation and Smart Values. Please help! Thank you in Advance.

2 answers

1 accepted

0 votes
Answer accepted
Gaurav
Community Champion
February 9, 2022

Hello @gowri.kumar 

There are a couple of alternate options to achieve this, apart from the option suggested by @Pramodh M

1. If the values for Impact and Probability are pre-defined; then you can create an If-Else construct in the Automation and define the value of Score, as you would know the options beforehand.

2. If the values es for Impact and Probability are not pre-defined; then you can create automation as per the below screenshot.

Please share in case you need further support.

NOTE: Impact is a common field that can cause an issue. To avoid that, I have used Impact1 as temporary workaround.

Automate Multiply 1.PNGAutomate Multiply 2.PNG

gowri.kumar February 9, 2022

Hi @Gaurav 

In this case it just returns empty value, even though the audit log shows success

Screenshot 2022-02-09 at 5.46.34 PM.png

 

Result:

Screenshot 2022-02-09 at 5.47.46 PM.png

Gaurav
Community Champion
February 9, 2022

Hello @gowri.kumar 

Kindly share the screenshot of the automation rule. I have tested the rule which I shared and it worked fine.

gowri.kumar February 9, 2022

Thanks @Gaurav.

Please find the screenshot of the rule below. Also, do note that the fields belong to a Team managed project and they are List type custom fields.

Screenshot 2022-02-09 at 6.04.37 PM.pngScreenshot 2022-02-09 at 6.04.46 PM.png

Gaurav
Community Champion
February 9, 2022

Hello @gowri.kumar 

For the drop-down field types, it can be simply set as the below screenshot.

Kindly accept the answer if this helps.

Automate Multiply with List.PNG

Like Shatakshi Sahney likes this
gowri.kumar February 9, 2022

Hi @Gaurav ,

Thank you once again. It works now!

 

I had to change the name of the custom field 'Impact'. If I name the field 'Impact' it still has this problem. not sure why though.

0 votes
Pramodh M
Community Champion
February 9, 2022

Hi @gowri.kumar 

Welcome to the Community!!

Trigger - Field Value Chaged (Probabilty, Impact )

Edit - Field value (Score)

{{#=}}{{issue.Probabilty}} * {{issue.Impact }}{{/}}

Reference here

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

https://support.atlassian.com/cloud-automation/docs/examples-of-using-math-expression-smart-values/

Thanks,
Pramodh

gowri.kumar February 9, 2022

Unfortunately I already tried that and received the following error in Audit log:

Error rendering smart-values when executing this rule:

Unknown unary operator * at character position 1: *

Like Noah Hofmann likes this
gowri.kumar February 9, 2022

Hi @Pramodh M 

I think the above formula you have mentioned would also work as long as the field name is not 'Impact'. The issue seems to exist with the custom field name (Impact) and not the formula itself.

Suggest an answer

Log in or Sign up to answer