Forums

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

Examples of use Automation for Jira branch "Current Issue"

Patrick van der Rijst
Contributor
March 24, 2025

Hello!

I'm reading through this article:

https://support.atlassian.com/jira/kb/how-to-use-current-issue-vs-trigger-issue-for-create-or-edit-issue-action-in-the-jira-automation/

To me it seems that both examples do exactly the same so I don't see the real example when to use the branch "For: Current issue" could be useful.

I've made this example Automation rule and you can see that both comments are placed in the same issue.

If I wanted to have a comment being added in the created issue, I could branch over the newly created issue(s).

So my question is, do you have examples when you're using the "For: Current issue" to solve something that's not possible otherwise?

Screenshot 2025-03-24 at 19.42.13.png

Screenshot 2025-03-24 at 19.42.24.png

2 answers

2 votes
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 24, 2025

Hi @Patrick van der Rijst 

Yes, and...to John Funk's ideas:

One of the only use cases I know for the Current Issue branch (recently renamed Current Work Item) is using conditions AND continuing with the rule flow in step-order rather than halting.  The reason that works is branches on one-and-only-one thing are executed sequentially (as if the branch did not exist), as compared to other branch types which run in parallel and asynchronously.

For example, one case is repeatedly updating the same work item for different conditions:

  • trigger: some trigger which returns 1-to-many work items
  • related issues branch: Current Work Item
    • condition: test something 
    • action: perform some action to the work item
    • action: Re-fetch Work Item Data
  • related issues branch: Current Work Item
    • condition: test something else
    • action: perform some other action to the work item
    • action: Re-fetch Work Item Data
  • ...

Without those branches, the rule would halt as soon as it reached the first condition which did not pass.

 

Regarding that article's explanation of {{triggerIssue}} versus {{issue}} (i.e., "current issue"), this is a matter of scoping: {{triggerIssue}} is always the same and {{issue}} changes based on where you are in the rule when {{issue}} can change when inside of a branch over work items.

  • trigger: some trigger that returns a work item -- At this point, {{triggerIssue}} and {{issue}} are the same.
  • action: some action -- At this point, {{triggerIssue}} and {{issue}} are the same.
  • branch: to some work items (e.g. on JQL returning more than one issue) -- At this point, {{triggerIssue}} and {{issue}} are the same.
    • action: another action -- At this point, {{triggerIssue}} and {{issue}} are different, where {{issue}} changes as the branch loops
  • action: some action after the branch -- At this point, {{triggerIssue}} and {{issue}} are the same again

 

Kind regards,
Bill

Patrick van der Rijst
Contributor
March 25, 2025

One of the only use cases I know for the Current Issue branch (recently renamed Current Work Item) is using conditions AND continuing with the rule flow in step-order rather than halting.  The reason that works is branches on one-and-only-one thing are executed sequentially (as if the branch did not exist), as compared to other branch types which run in parallel and asynchronously.

 

Yep I know about the async run of branches, which is often annoying when you'd like to retrieve a value from a branch and continue in the main branch.

Regarding the using conditions and continuing, you can do the exact same thing with IF / ELSE blocks right?

Note I'm not looking for a discussion on what's better, I just can't think of good examples when to use this branch type.

 

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 25, 2025

Understood...which is why I gave that example :^)

Using an if / else block will (in theory) execute for one matching block...but not multiple ones.  And so when multiple blocks of execution are needed, the example I gave helps.  Please note my "in theory" comment, as I recall there are open defects for edge cases when the if / else block processing does not happen as expected.

Regarding branch processing, there is an in-progress suggestion to improve / configure the behavior, and there is no information yet from Atlassian regarding what they plan to implement.  Please watch that one here to see progress: https://jira.atlassian.com/browse/AUTO-32

1 vote
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 24, 2025

Hi Patrick,

So you don't have a specific instance in mind, you just want to know in general? 

I use it in cases where I am already under an IF/ELSE tier of conditions and can't do that more more. So there are multiple branches for Current Issue to kinda serve that same person. 

Patrick van der Rijst
Contributor
March 25, 2025

Could you share an example of what that Automation rule is doing?

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