Why is my IF statement being ignored in automation?

Glen Cochrane
Contributor
January 12, 2024

I've read similar questions and answers but none have helped me. My scenario and rule seems very simple and I cannot see why it fails. It has worked for other projects when cloning between JSM and JWM projects.

  • In our JSM project, when an issue transitions from In Progress to Under Review we want the issue cloned to a Product Discovery project as an Idea.
  • The JSM workflow allows for (requires) the issue to move out and back in to Under Review.
  • To prevent duplicate clones, I have an IF statement to ignore issues if linked issues exist of type Clones or Is Clone By (screenshot below).
  • The problem is, upon re-transition to Under Review (linked issues now exist) the automation is ignoring the IF statement.
  • The cloning shouldn't occur again.

Rule details:

  • Scope = Multiple Projects (includes the two reference projects)
  • Trigger transition statuses only exist in the one JSM project

Thanks for your help :)
Glen

jira-automation-rule-if-fail.png

2 answers

1 accepted

2 votes
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.
January 12, 2024

Hi @Glen Cochrane 

Looking at your rule and audit log images...

Is this rule defined in the ZPT project, or as a global rule with multiple-project (or global) scope?

If it is defined only in ZPT, I believe the links cannot be "seen" because the other project is out of scope for the rule.  To solve this, move the rule / change the scope to include both projects.

Kind regards,
Bill

Glen Cochrane
Contributor
January 12, 2024

Hi @Bill Sheboy ,

In my OP description, I noted:

Rule details:

  • Scope = Multiple Projects (includes the two reference projects)

Is this what you mean?

It is a multiple project rule and the two projects ZPT and APID are added as its scope.

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.
January 12, 2024

Thanks; I missed that part, as it would certainly cause that symptom.

Your audit log image shows a configuration change in the rule between what I assume was the successful run at 11:54:04 am and the incorrect one at 12:02:39 pm.  You note the change was inconsequential; what changed?

Another way to test if those links are visible to the rule (or if the condition is broken) is to use a Lookup Issues action with JQL and the linkedIssues() function, testing for the exact link type.  If the lookup returns issues when the condition does not work, that would confirm the condition is not working as expected.

Glen Cochrane
Contributor
January 12, 2024

Hi @Bill Sheboy ,

The inconsequential config change was editing the rule description.

However, since the 2nd failed run I realized that while I had the automation set as Multiple Project and had the two projects added, my IF statement was only naming the ZPT project.

I added the APID to the IF condition restriction and that seems to have been the fault. I wasn't considering that the IF needed to "see" APID at this stage.

Thanks all for the input and help!
Glen

jira-automation-rule-if-scope.png 

Like # people like this
0 votes
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2024

Hi @Glen Cochrane - Can you please share a screenshot of your audit log for this rule?  It would help us understand what's happening.

Glen Cochrane
Contributor
January 12, 2024

Hello @Mark Segall - thank you for the response.

Below is a screenshot of the two rule runs. (The config change seen inbetween is inconsequential).

Also note, the error of "Unknown field = Attachment" is false; a known bug. The attachments do clone to the new issue.

jira-automation-rule-if-fail_log.png

Suggest an answer

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

Atlassian Community Events