I'm creating multiple issues via Post-Function, and I want the created issues to be 'related'.

Wade Sturman July 5, 2019

I have a Create Issue on Transition Post Function that will create multiple issues based on a multiple values in a custom field.

For Example: Issue X is transitioned from 'In Draft' to 'In Design' >> this creates two issues on separate boards.

  • these issues (Issue A & Issue B) both say 'Blocks Issue X'.

is there any way to automatically relate Issue A & Issue B to each other? 

  • Ideal State:  Issue X transitioned, Issue A & Issue B are created AND have two linked issues:
    • 'Blocks' Issue X
    • 'Relates to' Issue A or B

It seems logical that if two issues are blocking the same original issue, that they'd be linked together as 'related to'.

I cannot figure out how to make this happen, and I'm using the Automation for JIRA addon.

Any help would be greatly appreciated.

1 answer

0 votes
Ismael Jimoh
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.
July 6, 2019

Hi @Wade Sturman ,

First you would need an add-on like JIRA Misc Workflow Extensions or Scriptrunner for this.

Next, have a look at the following pages for samples on linking issues:

The above are just samples and you could find more on the community based on older questions though you need to be familiar with Groovy scripting.

Cheers.

Wade Sturman July 8, 2019

Hey @Ismael Jimoh , thank you so much for the response! I have a couple clarifying questions to make sure I understand your comment.

 

  1. We have scriptrunner, so I think we can try to use that. The link that you provided, does that scrip satisfy the use-case I specified above? The reason I ask is because i'm not sure we're looking to link the issue back to the original issue; instead, we're looking to link issues together with 'relates to' if they're created during the same post function.
    1. So, if Issue A & B are both created from a post function in the workflow for Issue X, Issue A would need to be 'related to' Issue B, and vice versa.

I hope this makes sense, and thank you for your help!

Wade

Ismael Jimoh
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.
July 9, 2019

Hi @Wade Sturman,

The link shared is to serve as a sample for linking issues. You would still need to create the issues separately.

  1. You would need to use scriptunner to create both issues.
  2. In the post-function of the issue, add a hashset that stores the issue key of both newly created issues. (Since these are created on the fly and we don't have much information on them, the hashset is a good way to grab the information of these created issues and store them temporarily so we can parse it to the method that links the issues together)
  3. Using the sample from the link earlier, link the issues that were created to each other.

If I am to start, I would focus first on creating an issue via the post function and then look at how to link them as the next step. (Usually when these issues are created, if they are created in the same project, their issue keys should follow each other.)

Cheers.

Wade Sturman July 9, 2019

Thanks for the response @Ismael Jimoh , that makes sense. It's not too hard to create multiple issues from a post-function, but it seems incredibly challenging to actually tie these issues together. Because they're going to be on different projects in most cases, i don't think we can rely on the issue keys following each other. 

I'll see if I can do this with two separate post functions in the same transition.

Thank you!

Wade

Suggest an answer

Log in or Sign up to answer