Transition an issue based on an issue key using Jira automation
Asked by Sidharth verma:

I want to transition a specific issue which i have found using the search in a particular status. but when i use the transition and issue automation it gives me an option to only move the issue which has triggered the automation. How can i move a specific issue based on issue key or any other value of the issue ?


Answers:
author: Trudy Claspill
body: Hello [@Sidharth verma](/t5/user/viewprofilepage/user-id/5442718)

I had a typo in my previous reply, which I have now edited. I meant to say you **can't** have one branch dependent on the actions of another branch.

Before I can provide any additional advice I need to understand what you are trying to accomplish with your rule. In order to achieve that understanding I need more information from you:

1. Please provide images that show the entire automation rule.

2. Please explain in words what you want to accomplish.

I don't understand what you are trying to accomplish with this branch.

![Screenshot 2024-08-23 at 9.27.25?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/343528i1CFE047A05C25639/image-size/large?v=v2&px=999 "Screenshot 2024-08-23 at 9.27.25?AM.png")

When you use a branch that typically means you want to take some actions for each of the issues identified in the branch command (the JQL you specified.

So, for each issue you find in the JQL you are then executing a Lookup Issues action that does not appear to be tied in any way to the information in the issues selected by the branch JQL.

And then you are creating at least one variable, and conditionally a second variable. What are the details of the statements you are using to set those variable values?

Then you are trying to run another branch based on a smart value. What are the details of that branch action?

comments: author: Sidharth verma
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

my main objective is hereunder:

I want to autoassign the issues based on the trigger when the assignee sends the issue to QA stage. the autoassignment should be done based on the below criteria:

1.) first check who all are the free team members. i.e. who are not assigned with any issues.

2.) based on whoever is free we need to first identify by scanning all the unassigned issues that a similar issue has been done by the free team member or not.

3.) If a similar issue has been done by the free team member, then transition the issue to the next stage and assign the issue to the free team member.

I am currently using assets to store the information about assignments so that i can easily query it based on other criteria's. below is the snapshot of my rule:

![Screenshot 2024-08-23 225043.png](https://community.atlassian.com/t5/image/serverpage/image-id/343532i97814C5A15397BBD/image-size/large?v=v2&px=999 "Screenshot 2024-08-23 225043.png")

![Screenshot 2024-08-23 225151.png](https://community.atlassian.com/t5/image/serverpage/image-id/343533iE573E414215C7C6C/image-size/large?v=v2&px=999 "Screenshot 2024-08-23 225151.png")

![Screenshot 2024-08-23 225242.png](https://community.atlassian.com/t5/image/serverpage/image-id/343534iB30E8CF3827B868D/image-size/large?v=v2&px=999 "Screenshot 2024-08-23 225242.png")

The rule is not fully completed yet and there might be some mistakes in it but in a nutshell i want to transition a specific issue based on the critirea i have mentioned above. do let me know if you have any more questions and i would be happy to answer.


author: Rebekka Heilmann _viadee_
body: Hi [@Sidharth verma](/t5/user/viewprofilepage/user-id/5442718)

what does your rule look like so far? Where did you search/find the issue?

Generally speaking, you'd need to branch the rule over whatever issues you want to edit. Any action in the branch will be on the "Current issue" rather than the "Trigger issue" per default.

Could you post a screenshot of your rule?

comments: author: Sidharth verma
body: Hi [@Rebekka Heilmann _viadee_](/t5/user/viewprofilepage/user-id/5182395),

below is the screenshot of the rule on how it looks like:

1.) branch 1 - i am trying to search for the issue key using various conditions using a JQL search. once i have found the issue key i put it in a variable called similarapp.

2.) Branch2 - I want to transition the issue that i have found in branch 1 only and no other issue. However, I am not sure if its going to work or not ?

Is there anyway i can find a solution to the above problem?

![Screenshot 2024-08-23 100929.png](https://community.atlassian.com/t5/image/serverpage/image-id/343379i39967CC0BCCE23E8/image-size/large?v=v2&px=999 "Screenshot 2024-08-23 100929.png")


author: Rebekka Heilmann _viadee_
body: The problem I see is that Branches don't wait for other branches to finish. So I assume there are no smart values to branch over at execution time.

You can check that by logging the Smart value with "Log action". Sometimes a "refetch issue" helps.


author: Trudy Claspill
body: EDITED: Correction where I said "can" and meant to say "can't"

Hello [@Sidharth verma](/t5/user/viewprofilepage/user-id/5442718)

There are a few problems with the structure of your rule.

1. Branches run in parallel. You ~~can~~ **CAN'T** have one branch dependent on information from another branch. Refer to: <https://confluence.atlassian.com/jirakb/in-the-automation-parallel-execution-of-the-branches-to-main-thread-can-produce-incorrect-unexpected-outcome-1115147731.html>

2. Variables you create in a branch do not exist outside of that branch. You can create a variable inside a branch and then use that variable anywhere outside of that branch.

3. Can you clarify your intention where you are using a JQL based branch to select issues and then using a Lookup Issues action after that? The Lookup Issues action does not appear to have any criteria related to the branch you have started based on the JQL. By branching on a JQL you are telling the rule that there are actions you want to take for each issue found by that JQL. How does your Lookup Issues action factor into that?

Also, please share the details of the variables you are creating. That might help us understand your intent.


author: Sidharth verma
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) ,

My intention is to find an issue in particular status using a JQL search and then transition that particular issue only to the next stage.

I am currently trying to add that into a variable and use the variable in the branch. from your comments now i understand that variable will not be available in the next branch which is fine. but if i were to populate the variable outside the branch and then run a separate branch using the smart value will be i able to transition that issue ?


author: Rebekka Heilmann _viadee_
body: So you only ever expect to find one specific issue with a set jql?


author: Sidharth verma
body: Hi [@Rebekka Heilmann _viadee_](/t5/user/viewprofilepage/user-id/5182395) ,

Yes...... but even if i get multiple issues.....can they be transitioned using the rule above ?


author: Rebekka Heilmann _viadee_
body: If you can, you should change the second branch to "JQL" and put in the query so you can branch over the jql results.

But from looking at the complexity of the first branch I'm not sure whether a single jql is sufficient..


author: Sidharth verma
body: Hi [@Rebekka Heilmann _viadee_](/t5/user/viewprofilepage/user-id/5182395)

No, a single JQL will not be sufficient. can't we branch it based on smartvalues and take the variable value as input to the transition action ?


author: Joseph Chung Yin
body: [@Sidharth verma](/t5/user/viewprofilepage/user-id/5442718) -

I agreed with what both ( [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) and [@Rebekka Heilmann _viadee_](/t5/user/viewprofilepage/user-id/5182395) ) leaders comments. Can you also provide what is your triggering event for the automation rule?

Please advise and looking forward in supporting you.

Best, Joseph Chung Yin

comments: author: Sidharth verma
body: My triggering event is when the packaging engineer moves an issue from packager inbox to QA or Packaging to manager status.

see below:

![Screenshot 2024-08-23 232515.png](https://community.atlassian.com/t5/image/serverpage/image-id/343557i3C84ED45D9B41AF0/image-size/large?v=v2&px=999 "Screenshot 2024-08-23 232515.png")


Tags: cloud

jira-service-management

jira-service-management-cloud