Forums

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

Smart value in automation : missing parameter(s) for operator +u:

Valerie Blondel
Contributor
March 8, 2023

Hi Team,

I am trying to use automation to calculate a sum of several custom fields, whenever one of them is modified. Result of the sum should appear in "Grand total des indices de risques".

For some reason, I am not successful.

Here are my fields and automations so far :

 

Automation 4.png

 

And my automations

Automatin 2.pngAutomation 3.png

The error I get :

Automation error.png

 

Would any one be so kind to have a look ?  What am I missing ?

 

Thanks a lot beforehand,

 

Valérie

3 answers

3 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.
March 8, 2023

Hi @Valerie Blondel 

Looking at the image you posted of the Create Variable action, it appears there are some typos in your mathematical expression. 

Some of the smart values start with

{{issue.fieldname.value}}

while others start with an extra character before "issue"

{{Iissue.fieldname.value}}

Please try removing those extra characters to see if that helps.

 

Kind regards,
Bill

Valerie Blondel
Contributor
March 8, 2023

Hi Bill,

I am going to buy better glasses ;-).

Thanks for the advice.  Tried it, but not working either.

{{#=}} {{issue."Ressources humaines Indice de risque total".value}} + {{issue."Direction Indice de risque total".value}} + {{issue."IT Indice de risque total".value}} + {{issue."Gestion de projet Indice de risque total".value}} + {{issue."Commercial Indice de risque total".value}} + {{issue."Customer Solutions Indice de risque total".value}} + {{issue."Production Indice de risque total".value}} + {{issue."ENV et BAT Indice de risque total".value}} + {{issue."Logistique Indice de risque total".value}}{{/}}

 

Would you have any other piece of advice ?

Thanks so much !

Valérie

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.
March 9, 2023

Okay, the next thing to check: are those the correct smart values for the fields?

Smart values are name, spacing, and case-sensitive.  And, just because something has a field that does not mean it is supported by automation rules (e.g., vendor addon, calculated fields).

To check your smart values, please use the how-to article below.  Basically you identify an example issue with your fields, call the REST API with a browser, and look for your fields to find the smart value.

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Also...If those are numeric (or text) fields, you should not need the .value part.  That is primarily used with single and multi-select option fields.

Like Kristopher Perez likes this
Valerie Blondel
Contributor
March 10, 2023

Hi Bill !

Thanks a lot ! Issue was coming from the .value that were not needed.

Learned a lot, thanks again !

Kind regards,

Valérie

Like Bill Sheboy likes this
0 votes
Answer accepted
Trudy Claspill
Community Champion
March 8, 2023
Valerie Blondel
Contributor
March 8, 2023

Hi Trudy,

Indeed, thanks for noticing and sorry for my mistake !

Valérie

0 votes
Answer accepted
Kristopher Perez
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.
March 8, 2023

Remove the quotes from the Custom Field names.  They aren't needed.

Also as a general troubleshooting method, I like to add an action to "Log action" with the Smart Value.  This will help make sure you get the value you need before making changes to issues.  You can see these values in the Audit Log for the Rule.

Finally, I would also recommend starting with a smaller set of thing to add.  It's really hard to debug a long string like that, so start with just adding 2 custom fields together.  Once you have the syntax correct, you can add the additional fields.

Kris

Valerie Blondel
Contributor
March 8, 2023

Hi Kristopher,

Thanks for your answer and suggestion.

I tried, but it is not working either

Kristopher.png

I also tried to reduce the string to 2 items and to insert an audit log, but here is what I got.

 

{{#=}} {{issue.Direction Indice de risque total.value}} } + {{issue.Qualité Indice de risque total.value}} {{/}}

Reduced string + log.png

 

Sorry, still on my learning curve :-(. I really appreciate the time you took !

Kind regards,

 

Valérie

Kristopher Perez
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.
March 9, 2023

There’s an extra } before the + Try removing that.

I would also look at @Bill Sheboy  suggestion of confirming the data structure of the custom fields. I have a feeling he is right about potentially not needing the .value at the end, but I can’t say for sure. If you visit the link he provided, they talk about how to look at the custom fields to figure out what you need.

Kris

Valerie Blondel
Contributor
March 10, 2023

Thanks Kristopher !

Issue was the .value, not needed because my fields are number fields.

Thanks again for your help!

Valérie

Felipe Fernandes July 7, 2023
{{#=}} {{issue.Direction Indice de risque total.value}} } + {{issue.Qualité Indice de risque total.value}} {{/}}

At this expression there is an extra } after {{issue.Direction Indice de risque total.value}}

@Valerie Blondel

Have you solved this issue? I'm with the same problem here.

 

thanks

FF

Valerie Blondel
Contributor
July 10, 2023

Hi Felipe,

 

Yes, solved in the meanwhile.  And yes, issue was coming from an extra }. 

It's sometimes difficult, in very long strings, to detect a missing } or one too much !  But with the help of the community (and some new glasses for me) we managed to do it.

Have a nice day !

Like Felipe Fernandes likes this

Suggest an answer

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

Atlassian Community Events