Forums

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

Linking issues in Jira automation

Jimmy September 28, 2020

When an issues is created it triggers the creation of other issues based on user inputs and currently i'm able to link those created issues to the original issue. I want to take it another step and link all the automatically created issues to each other as well so there's a matrix of linked issues. This will allow my users to see all of the linked issues regardless of whether they are viewing the trigger issue or any of the created issues.

2 answers

0 votes
Jimmy September 29, 2020

Hi @Gustavo Félix

Thanks for your recommendation, but I won't have an idea of what the issues are since they are automatically being created by the automation. This might explain better:

Issue 1 created then

Issue 2 created automatically (linked to issue 1)

Issue 3 created automatically (linked to issue 1)

 

I want Issue 2 and Issue 3 automatically linked as well.

Gustavo Félix
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 29, 2020

I thought you were creating them manually during a workflow postfunction.

0 votes
Gustavo Félix
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 28, 2020

I would try this:

List<Issues> list <- this should be filled with the issues you created before


  for( int i = 0; i< list.size() ; i++ ){
         for (int j=i+1; j<list.size(); j++){
           Create a link from list(i) to list(j) 
    }
}
If you have a 4 size list
first iteration:         list(0) link with list(1), list(2), list(3)
second iteration:   list(1) link with list(2), list(3)
third iteration:       list(2) link with list(3)

I'm assuming you dont want to link 1 with 2, and also 2 with 1. 

If you want that, then 
  for( int i = 0; i< list.size() ; i++ ){
         for (int j=0; j<list.size(); j++){
          if(i != j){
           Create a link from list(i) to list(j)
         } 
    }
}
first iteration:         list(0) link with list(1), list(2), list(3)
second iteration:   list(1) link with list(0), list(2), list(3)
third iteration:       list(2) link with list(0), list(1), list(3)
forth iteration:       list(3) link with list(0), list(1), list(2)    
 
I hope that gives you an idea.

Gustavo Félix
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 28, 2020

Note: I haven't try it, but I think it could work

Suggest an answer

Log in or Sign up to answer