Forums

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

Calculating 2 fields with smart values

Yulia Zhyliaieva
Contributor
December 1, 2023

I have the following expression for Edit issue field:

{{#=}{{issue.Impact.value}} * {{issue.Effort.value}}{{/}}

In the audit log, it says SUCCESS

but the field remains empty

4 answers

0 votes
Yulia Zhyliaieva
Contributor
December 3, 2023

Atlassian support replied and fixed my expression.
Now it works:

{{#=}}{{issue."Impact"|0}} * {{issue."Effort"|0}} {{/}}

0 votes
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.
December 1, 2023

Hi @Yulia Zhyliaieva 

What are the types of those fields?

If they are numbers, you may used them directly with either of these methods:

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

{{issue.Impact.multiply(issue.Effort)}}

The .value is only needed if the fields are selection fields.

Kind regards,
Bill

0 votes
Yulia Zhyliaieva
Contributor
December 1, 2023

Interesting update.
I experimented and set the default value of Prioritization calculated field (the one that needs to be updated) to 0.

Once I ran the rule, it changed from 0 to empty

0 votes
Antuan Sammak
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.
December 1, 2023

Hi @Yulia Zhyliaieva 

 

can you please add to you automation rule the action "log action" and add inside it {{#=}{{issue.Impact.value}} * {{issue.Effort.value}}{{/}} then try to run it and let me know what does it show in the logs of the rule.

 

also can you please share the type of the three below field:

- the filed you are trying to add to the result of {{#=}{{issue.Impact.value}} * {{issue.Effort.value}}{{/}}

- Impact

- Effort

Yulia Zhyliaieva
Contributor
December 1, 2023

All three fields are Number fields @Antuan Sammak 

Yulia Zhyliaieva
Contributor
December 1, 2023

Screenshot 2023-12-01 at 12.08.39.png

Antuan Sammak
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.
December 1, 2023

thank you @Yulia Zhyliaieva  for sharing the above.

since the two fields that you are multiplying are custom fields, you need to do the following:

 

setting from top right corner

issues

custom fields

search for each of the two fields and click edit details

new page will open

in the browser URL, you will find a 5 digit code..replace each of the fields in your rule like the following ex: instead of {{issue.Impact.value}} use {{issue.customfield_xxxxx(code from previous step}}

Yulia Zhyliaieva
Contributor
December 1, 2023

I already did that. The rule runs the same.

There is an interesting update on this case (above):

I experimented and set the default value of Prioritization calculated field (the one that needs to be updated) to 0.

Once I ran the rule, it changed from 0 to empty

Antuan Sammak
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.
December 1, 2023

apologies @Yulia Zhyliaieva  can you please try {{issue.customfield_xxxxx.value}} and let me know

Yulia Zhyliaieva
Contributor
December 1, 2023

This is how the expression looks now, and yet the desired calculated field is empty: {{#=}{{issue.customfield_11896.value}} * {{issue.customfield_11897.value}}{{/}}

Yulia Zhyliaieva
Contributor
December 1, 2023

Screenshot 2023-12-01 at 12.27.23.png

Yulia Zhyliaieva
Contributor
December 1, 2023

Another update - when I try to include different other fields into the automation rule, the placeholder is set to different values.

However, for my specific field it says that the field will be cleared.

Seems like whatever expression I fill in there, it does not matterScreenshot 2023-12-01 at 12.49.48.png

Antuan Sammak
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.
December 1, 2023

Hi @Yulia Zhyliaieva 

 

Allow me please to clarify few things first, having the 0 added by default to "Prioritization calculated" field then it becomes empty after running the rule, is expected behaviour since your equation outcome is null (as you can see from the automation rule log) and this null is replacing the 0

 

second, the placeholder message that you are seeing for this field "This field will be cleared" means that: whatever you will enter in this box will clear that field existing value and replace it with what you will enter 

 

last, i understand that this process might take a bit but in order to get to know the reason we would need to do some troubleshooting....can you please add to the automation rule few log actions and add to one of them {{issue.customfield_11897.value}} and to the other {{issue.customfield_11897}} and please make sure that this field has value.

 

also it would be great if you can share a screenshot for your entire automation rule so i can better understand the logic of it and from where it is triggered and how the values are being passed.

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