The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Automation smart values: numerical comparison with boolean And

Julia Foden
Contributor
February 10, 2021

Hi

I want to use automation to send an email and the text should vary based on the value of a select list field. The values are 1-10. 

I have it working for values greater than or equal to 7:

Risk: {{#if(issue.Risk.value.asNumber.gte(7))}} High risk {{/}}

But I would like it to say 'Medium Risk' if the value is less than 7 but greater than or equal to 4, and I can't get this working. For example this -

{{#if(issue.Risk.value.asNumber.lt(7))&& (issue.Risk.value.asNumber.gte(4))}} Medium Risk {{/}}

leads to this error:

Error rendering smart-values when executing this rule:Tokens must be separated by '.': && (issue.Risk.value.asNumber.gte(4)): Risk: {{#if(issue.Risk.value.asNumber.gte(7))}} High Risk {{/}} {{#if(issue.Risk.value.asNumber.lt(7))&& (issue.Risk.value.asNumber.gte(4))}} Medium Risk {{/}}

What changes do I need to make?

Thanks

 

 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
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 Champions.
February 10, 2021

Hi @Julia Foden 

Have you tried nesting the tests?  Perhaps something like this (assuming your field is called Risk and appears to be text):

{{#if(issue.Risk.value.asNumber.gte(4))}}{{#if(issue.Risk.value.asNumber.lt(7))}}Medium Risk{{/}}{{/}}

And maybe skip the && and just put all the tests end to end, knowing that at least one of them will evaluate to True.

Updated: sorry I left story points in my first example.  :^)


Best regards,

Bill

Julia Foden
Contributor
February 10, 2021

Yep that worked @Bill Sheboy , thank you very much!

Like Bill Sheboy likes this
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events