Forums

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

Linking newly created issues from an automation

Philip Witt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 24, 2024

Hi guys,

I have project A, B, and C. Im trying to create an automation rule in project A which creates an issue in project B and another issue in project C.Automation 1.jpg

 

I also want to link the issues in all directions: A-B & A-C & B-C. 

 

The links between A-B and A-C work by using "Choose fields to set..."Automation 3.jpg

The problem I'm facing is the link between the newly created issues in project B to C.

Is it possible to create these links? I believe I need to create a variable and use JSON, so I have already expanded my automation rule to this:

Automation 2.jpgAutomation 5.jpgAutomation 4.jpg

When I do this, I create a link between B to C. Yay! But the link between A and B won't work anymore :( 

I believe I'm on the right track with the variable and JSON. Do I have to put JSON in the action "Create (2nd) issue" (I think I've tried it before but it didnt work either)? Does it have to be in a new action at the bottom in the action "edit fields"? Is something else missing? Is the structure off?

 

Any help is much appreciated! :)

1 answer

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.
September 24, 2024

Hi @Philip Witt -- Welcome to the Atlassian Community!

The structure of your complete rule will determine if this scenario is possible.  To confirm this, please post an image of your complete rule in one single image for context.  (This may be captured with an image capture tool or browser add-in for scrolling-page capture.)

Until we see that information...

The keys for a scenario like this are:

  • saving the keys of the issues as they are created for later usage in issue linking, and
  • using a multiple-project or global scope rule.  (Single-project scope rules may create issues in other projects, but cannot access or update them otherwise, and so the linking would not work.  Instead the rule must be multiple-project or global in scope.  Your Jira Site Admin will need to help for changing a rule's scope.)

Kind regards,
Bill

Philip Witt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 25, 2024

Hi Bill, thank you for your reponse! :)

Scope is something I havent thought about yet, right! However, since the creation of the issues and some of the links work, I dont think this is the main reason for the problems I am facing. However, I have the necessary Jira site admin permissions if needed.

 

I have two versions of the automation rule by now.

 

#1

The first automation rule has JSON as part of the second "And: create a new..." action.

Automation 7.jpg

 Automation 9.jpg

--> Triggering this automation rule will create the two issues succesfully. However, I am missing the link between project A and project B. The links between A and C as well as B and C are there.

 

#2

This automation rule has JSON in a separate action "And: edit issue fields". 

 

 Automation 6.jpg

automation 8.jpg

 -->Triggering this automation rule will create the issues successfully. Now, however, I am missing the link between B and C, which are the newly created issues. 

 

 Both automation rules share the same setup for the variable:

Automation 5.jpg

Unfortunately, I can find a way to create links in all directions: A-B & A-C & B-C.  :(

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.
September 25, 2024

Thanks for that information, and I still believe this can be done in one rule (if the intent is to manually trigger it and create all the issues at once.

If you save the key after each issue is created, and then use branch on JQL, this will work.  For example:

  • trigger: manual
  • if / else condition
    • ... conditions to decide if creating issue in project A
    • action: create issue A
    • action: create variable to save {{createdIssue.key}}; let's name this one varKeyA
  • else / if condition
    • ... more conditions, repeating the above pattern to save the keys
  • branch: on JQL to the project A issue with key = {{varKeyA}}
    • action: use either edit issue or link issues with the other issue keys to link them
  • repeat as needed for the other issues

 

If you do not create all of the issues (A, B, and C) you could add additional conditions to check if the variables have a value before trying to link them.

Suggest an answer

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

Atlassian Community Events