Error when calculating via Automation. Too many numbers or variables

Alexander February 6, 2021

When creating a new task through Automation, the data should be calculated using the formula:
{{# =}} ({{issue.field_1}} * 0.4 + {{issue.field_2}} * 0.5 + {{issue.field_3}} * 0.6) / {{issue.field_4} } * 100{{/}}


Where fields 1-4 are filled in when creating a task


Gives an error message :
Error rendering smart-values when executing this rule:
Too many numbers or variables: (2 * 0.4 + 1 * 0.5 + 3 * 0.6) / 4 * 100

Where did I go wrong?

1 answer

1 accepted

1 vote
Answer accepted
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2021

Hi @Alexander 

Please follow the following change and please let me know if this works

({{issue.field_1}} * 0.4 + {{issue.field_2}} * 0.5 + {{issue.field_3}} * 0.6) / {{issue.field_4}} * 100

 

Automation_1.png

 

Thanks,
Pramodh

Alexander February 6, 2021

Hi @Pramodh M !


This works, but it will only output incorrect data: instead of, for example, "0.011142857" it produces "111.429"

Fields 1-4 are of type  "Select List (single choice)"
Field 5, where data is output  "Number Field"


Could it matter?

Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2021

Well, since your input is a number, you can have Fields 1-4 as number fields. Well, it should work for the Single select list as well. Divide it by a hundred and we will get the result, I do not guarantee about the decimal places it results in,

(({{issue.field_1}} * 0.4 + {{issue.field_2}} * 0.5 + {{issue.field_3}} * 0.6) / {{issue.field_4}} * 100) / 100


Thanks,
Pramodh

Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2021

FYI, Divide it by a thousand!

Alexander February 6, 2021

I think it should be divided by ten thousand, but somehow this is not correct ((

Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2021

Sorry for the mistake, here's the correct one.

(({{issue.num_field_1}} * 0.4 + {{issue.num_field_2}} * 0.5 + {{issue.num_field_3}} * 0.6) / {{issue.num_field_4}} * 100 / 10000)
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2021

Can you please send me the screenshot of the math solution by one example. BODMAS is hitting here! we may solve this with fewer operations..

Alexander February 6, 2021

Here it works:

({{issue.num_field_1}} * 0.4 + {{issue.num_field_2}} * 0.5 + {{issue.num_field_3}} * 0.6) / {{issue.num_field_4}} * 100 / 10000
Like # people like this
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2021

Great!

Like Stuart Capel - London likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events