We've got some numeric values, and I wanted to create a automation calculation to come up with a final "total score".
1st I set triggers (I think they are not so important here)
2nd I added smart-value-variable {{total score}} (does not know if that is actually necessary, since the field "total score" already exists)
3rd variable creation ("total score" field value).
{{#=}}{{issue.customfield_10091}}{{/}}{{issue.customfield_10090}}{{*}}{{issue.customfield_10081}}{{*}}{{issue.customfield_10092/100}}
Anyone got feedback to this calculation which leads to the error EINIGE FEHLER (some errors/non specified)?
Hi Claas,
Try this:
{{#=}}{{issue.customfield_10091}} / {{issue.customfield_10090}} * {{issue.customfield_10081}} * {{issue.customfield_10092}} /100{{/}}
If that's what you are trying to do. That will divide the first number by the second number THEN multiply that answer by the third number THEN multiply that answer by the fourth number. Finally, that answer will be divided by 100.
I don't think that's what you want to happen, but maybe it is.
@John Funk
Unknown unary operator * at character position 14: 3.0 / 6.0 * * 1139.0 /100
I think that you always need to {{}} operators, at least this is what I learned from the automation resource board.
I tried to rephrase yours but
/100 {{/}}
as well as
{{/100}}
as well as
{{/100}}{{/}}
result in
Error when processing the template: Mismatched start/end tags: null != 100 in template-95e3eadf-682e-4895-a61f-8beaf8244d5d:1,
so I cannot even publish the automation.
I just need an idea now on how to dived the whole calculation by 100 and how to avoid
"Could not convert the field value to a number. Please ensure that the value is a number, a mathematical expression or a smart value that can be converted to a number.
Total Score: 1362.037.51736.0
No fields or field values to edit tasks (possibly due to field values not being present in a particular project):"
(See post below answering @Valerie Knapp )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
(Votes/Views) * ((TotalMRR*(FoxlyScore/100))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Claas Babendererde
You should not be putting your mathematical operators in curly braces {{ }}. See the documentation here:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/
Looking at the statement provided by John:
{{#=}}{{issue.customfield_10091}} / {{issue.customfield_10090}} * {{issue.customfield_10081}} * {{issue.customfield_10092}} /100{{/}}
...and comparing that to your error message:
Unknown unary operator * at character position 14: 3.0 / 6.0 * * 1139.0 /100
Notice that you have two "*" next to each other in the error message. That means that field {{issue.customfield_10081}} has no value. That is the cause of the error.
Value from error | associated field from formula |
3.0 | issue.customfield_10091 |
6.0 | issue.customfield_10090 |
issue.customfield_10081 | |
1139.0 | issue.customfield_10092 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adding to what the others have suggested...
When one of your fields could be empty, what do you want to happen? If there is a default value to use, that can be supplied with the pipe | operator.
For example, let's assume you want your custom field to default to 1 when it is empty:
{{issue.customfield_10081|1}}
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, that was all very helpful.
I also got an error when applying @John Funk solution meaning leaving out curly brackets.
Thx @Bill Sheboy this comment was too helpful, this was exactly my next question. Thx so much :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Based on your feedback above, give this a try:
{{#=}}({{issue.customfield_10091|0}} / {{issue.customfield_10090|0}}) * (({{issue.customfield_10081|0}} * ({{issue.customfield_10092|0}} /100)){{/}}
This includes your groupings and setting each field to 0 if there is no value. If you want the value to be 1 instead of 0 if it is missing, then simply change that value in the formula.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And also...There are at least two ways to perform math operations with rules: math expression and chained/inline. Knowing both can help in different circumstances.
The math expression you have already used. This can help when you want the expression more human-readable or when there is conditional logic.
The chained/inline one literally describes the operation, and you need to think about how to do them, in left-to-right processing. I believe your example could be this:
{{issue.customfield_10091.divide(issue.customfield_10090).multiply(issue.customfield_10081).multiply(issue.customfield_10092).divide(100)}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Guys @Bill Sheboy @John Funk @Trudy Claspill @Valerie Knapp it finally worked with your suggestions.
Thank you all!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Claas Babendererde , thanks for your question.
If you aren't getting a clear reason for why the automation isn't working, I typically also add an action putting the same calculation into the audit log -
You could also put different variations of the calculation in here, to see how far you get before it fails for example.
{{#=}}{{issue.customfield_10091}}{{/}}{{issue.customfield_10090}}{{*}}{{issue.customfield_10081}}{{*}}{{issue.customfield_10092/100}}
Like
{{#=}}{{issue.customfield_10091}}
{{#=}}{{issue.customfield_10091}}{{/}}{{issue.customfield_10090}}
{{#=}}{{issue.customfield_10091}}{{/}}{{issue.customfield_10090}}{{*}}{{issue.customfield_10081}}
and so on. Have you already tried something like this? What was the result?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thx so much for your suggestion.
I did not get the reporter thing working nor did I understand how it could help me. But I tried to ease the calculation.
You need at least {{#=}}{{issue.customfield_10091}}{{/}}{{issue.customfield_10090}}
It works!
Adding
{{#=}}{{issue.customfield_10091}}{{/}}{{issue.customfield_10090}}{{*}}{{issue.customfield_10081}}
It works!
Hence the issue is the expression {{issue.customfield_10092/100}}
What I wanted to do:
(A/B*C)*(D/100)
I replaced to
{{#=}}{{issue.customfield_10091}}{{/}}{{issue.customfield_10090}}{{*}}{{issue.customfield_10081}}{{*}}{{issue.customfield_10092}}
(left out division by 100) and it works.
Still I get a error code (translated by deepl)
Edit operation
Could not convert the field value to a number. Please ensure that the value is a number, a mathematical expression or a smart value that can be converted to a number.
Total Score: 1362.037.51736.0
No fields or field values to edit tasks (possibly due to field values not being present in a particular project):
This is astonishing, since there are only complete numeric values except mrr, which can be like 1240.24 (always two values post .)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.