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.
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.