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 Value Between Two Numbers

Mathew Lederman
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.
March 18, 2025

How do I determine if a smart value is between two numbers?

Example: If 50 < {{Smartvalue}} < 100

The Smart Values condition only allows you to do a single compare from what I can see.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
March 18, 2025

Hi @Mathew Lederman 

Without seeing your entire rule for context...

Please try the and() function to combine the logical tests: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#and

And also note that function only accepts two parameters; when more clauses are needed, they may be nested.

Kind regards,
Bill

Mathew Lederman
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.
March 18, 2025


Bill,

Appreciate the link. Perhaps you can help me with what I'm getting wrong.

Here is the action I'm using. The goal is to set the PO Spend Category attribute to 499 - 250 if the PO Value is between 499999.99 and 249999.99

{{#if(and({{lookupObjects.PO Value}}.gt(249999.99),{{lookupObjects.PO Value}}.lt(499999.99)))}}
499 - 250
{{/}}

I'm getting a "Parameters not closed" error, but from what I can see everything is closed properly.

G5nn7KAA3B.png

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.
March 18, 2025

Once inside a set of double-curly brackets, additional ones are not needed.  Perhaps try this expression:

{{#if(and(lookupObjects.PO Value.gt(249999.99),lookupObjects.PO Value.lt(499999.99)))}}
499 - 250{{/}}

 

Mathew Lederman
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.
March 18, 2025

Sorry, I still seem to be running into issues. The edit object was failing, so I've tried outputting the results of the query you provided to the log shown below. It doesn't return anything even when a PO Value matches the logic. Any idea what I'm missing?

kUXBIMGbZp.png

 

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.
March 18, 2025

Would you please show the current, complete rule and of the complete audit log details for the rule execution?

 

And...inline math expressions require the values to be numbers.  I wonder if lookupObjects.PO Value is returning a list of values and / or it is a text value.  The way to check the second one is to add asNumber conversion before the gt: and lt() tests:

{{#if(and(lookupObjects.PO Value.asNumber.gt(249999.99),lookupObjects.PO Value.asNumber.lt(499999.99)))}}
499 - 250{{/}}

 

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events