Forums

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

Jira Automation - trigger issue not showing in JQL branch

Rees_ Ian
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.
May 2, 2024

I am creating an automation, that has a manual trigger.  It looks at the fix version that the trigger issue is assigned to, then does a JQL branch based on "Fixversion= the fix version of the trigger issue

The problem I am having is that the logic in the JQL branch, never includes the trigger issue.  I have cut this down to a very simple script as follows

Arule.PNG

Arule2.PNG

 

3 answers

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.
May 2, 2024

Hi @Rees_ Ian 

My understanding is by default, automation rules with an issue in the trigger then remove that issue in any branching.  That is, the rule engine explicitly adds this to your JQL behind the scenes.  This is likely to prevent looping errors.

AND key != {{triggerIssue.key}}

One way to observe this is to intentionally add an error to dynamic JQL, and the broken JQL will show the addition in the audit log.

 

The workarounds for this depend upon your scenario...

  • If you want to count, sum, average, etc. a set of issues, use the Lookup Issues action with JQL, as that will not exclude the trigger issue
  • If you want to perform the same action on a group of issues, including the trigger issue, duplication is needed:
    • branch to the current issue, and perform the action
    • then branch to the remaining issues with JQL
  • Or...alter your trigger to not have an issue, such as with a scheduled trigger with no JQL

Kind regards,
Bill

Rees_ Ian
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.
May 3, 2024

Thanks for the explanation Bill - that would make sense. Now I know it is intentional logic, I am working around by doing everything in the branch and then doing the trigger issue separately. Thanks

Like Bill Sheboy likes this
0 votes
Rees_ Ian
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.
May 3, 2024

error

0 votes
Kalyan Sattaluri
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.
May 2, 2024

Hello @Rees_ Ian 

Can you share what are you trying to do?

For ex, You could also, instead of branch, do a lookupIssues before your branch, with same JQL and do an Advanced Branch on {{lookupIssues.key}} instead and act on your result set.

Rees_ Ian
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.
May 3, 2024

Thank you for the suggestion Kalyan but I am not counting, summing or averaging issues - I am creating a new fixversion which is a clone of another fix version i.e. the issues in it are also Clones. I think the answer is to do everything in the branch and do the trigger issue separately. Thanks

Kalyan Sattaluri
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.
May 3, 2024

Great to hear.  Just FYI, you can do what you have mentioned in 1 step by Adv Branch on lookupIssues results also. Either way, many ways to do this and glad you got it sorted, Thanks!

Suggest an answer

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

Atlassian Community Events