Forums

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

Conditional Logic Smart Values Not working as Expected

Andrew L_ Chlup March 19, 2025

I have an automation that I'm using form data to drive an automation:

I've tried to equivalent approaches, but get different results and I'm not sure why.

LogicTests

Case 1 - Variable

RedAdv = {{issue.forms.717a0542-5b22-4ed3-926e-b541c9eb5fd7.RegAdv.label.get(0)}}

{{if(equals(RegAdv,"Yes"),issue.forms.717a0542-5b22-4ed3-926e-b541c9eb5fd7.RegAmount,0)}}

It returns the value expected

Case 2 - Smart Value

{{if(equals(issue.forms.717a0542-5b22-4ed3-926e-b541c9eb5fd7.RegAdv.label.get(0),"Yes"),issue.forms.717a0542-5b22-4ed3-926e-b541c9eb5fd7.RegAmount,0)}}

It fails and returns 0

{{RegAdv}} and {{issue.forms.717a0542-5b22-4ed3-926e-b541c9eb5fd7.RegAdv.label.get(0)}} return the same value so the context seems the same.
Screenshot 2025-03-19 091835.png

Any idea why it only works with a variable and not a smart value?


Screenshot 2025-03-19 091650.png

1 answer

1 accepted

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

Hi @Andrew L_ Chlup 

First thing, I am just another Jira customer and have no internal knowledge of the automation engine's implementation.  My suggestions are based on my experience and observations using rules.  With that out the way...

 

Some data in rules is usually available when the rule starts (e.g., fields in a trigger issue) while other data is looked up just-in-time to improve rule performance (e.g., sub-tasks, form data, assets, third-party addon custom fields, etc.)  This behavior can create side-effects / problems in rules where all of the needed data is not ready fast enough to do what is needed; that is, a racetrack error happens.

When your rule stores the form data in the created variable, that looks up the data to complete the expression before the next rule step happens.

But without the variable and inside the conditional expression, it may not be looked up fast enough before the condition's equals() function completes.

 

There is another, less likely, possible cause: perhaps form fields do not work inside the equals() logical condition function.  Some smart values do not work with some functions, and there is limited documentation to explain when these situations occur.

 

Please note my "usually available" from earlier.  Even standard issue fields may have this problem with some rule triggers.  An example for Jira Cloud is the Issue Created trigger, where the rule can start before all issue data is "ready", potentially leading to errors and other weird behaviors.  The mitigation for that symptom is to always add the Re-fetch Issue action immediately after the Issue Created trigger, slowing the rule a bit and reloading the data before proceeding.

 

Kind regards,
Bill

Andrew L_ Chlup March 19, 2025

Thanks Bill. 

I had a similar thought on timing, seen a number of cases where similar things happen.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events