Forums

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

Jira Automation: Smart Value "if" not working in Create Variable

Dominic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 14, 2025

Hello,

I'm currently pulling my hair out because I cannot get a simple IF clause to work in Jira Automation.  

I am using: Jira v9.12.22 (Data Center - not cloud).

I want to perform a simple compare using a jira smart value conditional logic.

So I have created the following automation:

1. Create Variable: 
Name: A
Smart value: apple

2. Create Variable:
Name: B
Smart value: apple

3. Create Variable:
Name: myResult
smart value: {{#if(equals(A, B))}} match {{/}}

4. Log Value:
myResult: {{myResult}}

 

myResult is empty in the log.

If I add a "not" to my IF ({{#if(not(equals(A, B)))}} no-match {{/}} 
then the result in the log is "no-match".

There are no spaces around the word apple in either create variable component.

This seems so simple but I cannot work it out.

Thanks for your help

4 answers

1 vote
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 18, 2025

Hi everyone, 
Just to follow up here, this appears to be a bug in a specific version of Automation within Jira Data Center that is causing the equals smart value to be incorrect.  You can track that in JIRAAUTOSERVER-1148 

It appears that this bug is not reproducible in at least Automation 9.2.5 and later.

1 vote
Manja
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 14, 2025

Hi @Dick

we have the same issue.

We are using Jira Software 9.12.22 with Automation for Jira 9.0.7

Best regards, Manja

Dick
Community Champion
July 14, 2025

Hi @Manja 
Thanks for reaching out. Since this is easy to test, I've alerted Atlassian. They intend to look into the problem within two days. 

Kind regards,
Dick

Like Calvin likes this
1 vote
Dick
Community Champion
July 14, 2025

Hi @Dominic Welcome to the Atlassian Community.

I tried to recreate your problem (I'm using Jira Datacenter version 10.3.7). I was not able to re-create the behavior you observed. The automation finds the match, as shown in the picture below. (I used square brackets to be able to see null values, should they occur).

Kind regards,
Dick

 

Test if If works.png

Dominic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 14, 2025

Hi Dick, 
many thanks for the reply.  Here's my output..

Sometimes there are just days when you think you're crazy and this is one of those for me!  

I'll try to see if there's anything in the release notes.  puh....

image.pngimage.png

Like Calvin likes this
Dick
Community Champion
July 14, 2025

Hi @Dominic could you state the Jira version you're working with?

It would shrink the haystack when looking for an explanation.

Kind regards,
Dick

 

oh, and for completeness: the if statement I defined is the same as yours:

Test if If works def.png

Like Calvin likes this
Dominic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 14, 2025

Hi Dick,

does this help...

Jira v9.12.22 (v9.12.22#9120022)

JIRA Service Management Application v5.12.22

Thanks 

Like Calvin likes this
0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 14, 2025

Hi @Dominic 

I understand that you are creating a pair of variable in an automation rule and then comparing them to save that value to a third variable, but that this comparison is not working as expected.  I think I know what might cause this.

Jira's automation can sometimes allow the actions to be carried out either too quickly, or nearly synchronous in nature.  I think that the myResult is being compared at the same time variable B is being set or just before which returns an unexpected result.

Try this:

Insert a new action of Re-fetch issue data after variables A and B are set AND before you create the myResult variable.  This should allow for the first two variables to have been created and have their values set before you create the third variable which depends on their comparison for a value to set as expected.  You can set a delay execution of a second or two should suffice.

Let me know if that helps.

Andy

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.
July 14, 2025

Hi @Andy Heinzer 

Would you please explain further why you believe the actions could be asynchronous?  Is this specific for Jira Data Center's version of automation rules?

 

I understand branches which could be on more-than-one-thing are executed in parallel and asynchronously.  And some rule actions which lead to multiple issues' having data updates could have latency, such as with issue linking and adding attachments.  But creating a variable with a literal text value does neither of those: branching or external data storage.

 

Thanks, and kind regards,
Bill

Dominic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 16, 2025

Hi @Andy Heinzer 

sorry, adding a refetch didn't help:

image.png

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 16, 2025

Hi @Dominic 

Sorry to hear that did not help.  I created a support ticket on your behalf over in https://getsupport.atlassian.com/servicedesk/customer/portal/41/PSSRV-181894

Perhaps our Data Center support team can take a closer look at this to help further.

Thanks

Andy

Suggest an answer

Log in or Sign up to answer