Automation - Transition an issue after being created in a branch

Iñigo Ruiz June 14, 2024

Hi all, 

Is there a way to create a new issue inside a branch [I know how to do this], and then transition this created issue?

I would normally achieve this with branching, but because issues are created inside a branch, I don't know how to "sub-branch" a branch.

Some more background info:

  • I have an automation which copies an Epic and children issues (Epic 1 --copy--> Epic 2). It copies all children of Epic 1 and sets the copies' parent to Epic 2. The result is Epic 2, which is an exact copy of Epic 1. This works fine.
  • Children issues are copied in branches. There are multiple branches because I have different types of children issues and situations. For example:

Captura de pantalla 2024-06-14 a las 11.45.28.png

  • I want all copies of children issues to be transitioned to a different status just after they are created. Copied issues are created in Status A but I want them to, just after, be transitioned to Status B.

-> I have tried to achieve this using a separate rule that is triggered every time an Epic 2 is created. The rule transitions all children issues to Status B. However, because rules/branches run independently, some children issues are copied after this second rule has finished and they remain in Status A.

-> I have also tried to use a "for all created issues" branch (below), but again because branches run independently, some issues created in other branches are missed and remain in Status A.

Captura de pantalla 2024-06-14 a las 11.57.38.png

2 answers

1 accepted

4 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 14, 2024

Hello @Iñigo Ruiz 

You might consider using a Label on the newly created issues to flag them as ones that need to be transitioned. Then create a second rule that is triggered by Issue Created, with a condition to look for that label, transition the issue if present, and then remove the label.

Iñigo Ruiz June 17, 2024

Hi Trudy! This is easy and it worked. Thanks 😊 

The only problem is that when Automation removes the label, Jira sends an email notification to the Assignee because of our notification scheme (Edit Issue action). The only solution I see is to keep the label.

0 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.
June 14, 2024

Hi @Iñigo Ruiz 

To do this with one rule...after the issue is created, the rule could use the Send Web Request action to call the REST API function to transition the issue, passing the {{createdIssue.key}} and the correct transition id for the workflow.  As a disclaimer, I have not tried this approach in a rule before.

Hardcoding the transition id would be simple, but if you need this to handle possible workflow changes in the future, an extra step is needed to first call the REST API to get the available transitions for the issue, search for your status, and then extract the transition id.

If you want to try this approach, here are some references:

Kind regards,
Bill

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