Forums

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

Smart variables maths - testing custom field within a range

Daniel Wright September 29, 2025

Hello,

 

I'm trying to take a money value within a custom field and look against a range to return the number back from it. 

For example:

customfield <= 1000 return 1

customfield <= 10000 return 10

customfield <= 100000 return 100

 

If I take the custom field on its own issue.customfield_11073.asNumber I get 1566.0

 

In automation if I create a variable, and add this as a smart variable I get nothing back (blank variable) 

{{#=}}{{issue.customfield_11073.asNumber <= 100000.0 ? 2 : 0}}{{/}}

 

Can anyone give me a steer in the right direction. Thank you

1 answer

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.
September 29, 2025

Hi @Daniel Wright 

First, I recommend pausing the review the docs for conditional expressions and math expressions as your syntax seems incorrect.

Next, you appear to want the order of magnitude value in thousands.  That should be possible using a combination of the following functions: log10, min, max, and the power operator ^

I recommend solving this incrementally with test values, writing the results to the audit log.  You will also need to decide what should happen at edge cases, such as empty, negative, and zero values, or out-of-range values for rule math.

 

Kind regards,
Bill

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