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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dick,
does this help...
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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 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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.