Post Function - Create Issue - Link New Issue to Existing Issue

MAG-II April 7, 2020

Hello - 

I am in a tricky situation in my Jira project that I'm not sure how to solve. The transition that occurred in the attached screenshot Test.1 just created the linked Issue called VTEST-3947 CLONE - test.security fields (blue box).

Meanwhile, the current Issue in screenshot Test.1 was already linked with Issue VTEST-3946 test.security fields via a previous transition.

What I want to do here is find a post function that will automatically create an Issue link between VTEST-3947 CLONE - test.security fields and VTEST-3946 test.security fields. Both are linked with the current test.security fields Issue, but they are not linked to each other.

The attached screenshot Test.2 shows when on the profile page for VTEST-3946 test.security fields how it is not linked with the VTEST-3947 CLONE - test.security fields Issue.

I have plugins such as Adaptavist Scriptrunner as well as JMWE so I do have different options for post functions, I'm just not entirely sure how to work through this. If anyone has any advice or suggestions I would really appreciate it. Thanks!

 

 

Test.1.png

 

 

 

Test.2.png

2 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 7, 2020

Hi,

when you wrote "The transition that occurred in the attached screenshot Test.1 just created the linked Issue called VTEST-3947", what do you mean exactly? How did that transition create a new issue? Are you using a Create Issue(s) post-function?

Basically, the question is: when exactly do you want to link the second linked issue (VTEST-3947) to the first (VTEST-3946)? Whenever/however it is created (either by a post-function or manually)? Whenever it is linked to the main issue (VTEST-3945), even manually after the issue was created?

Or is it just that the same transition can run multiple times, and each time it creates a new linked issue? In that case, do you want to link the new issue to all previously linked issues?

And what is the link type you'd like between "child" issues?

MAG-II April 7, 2020

Hey David - 

Apologies for the lack of clarity in my initial post. I am using the Create / Clone issue(s) (JMWE add-on) post function to create the linked Issue on this transition.

The idea is to get the 2 Issues I mentioned, VTEST-3947 CLONE - test.security fields and VTEST-3946 test.security fields linked to each other as soon as the VTEST-3947 CLONE - test.security fields gets created and linked to the original Issue via the post function I mentioned in the top paragraph.

For more context - The ultimate goal I want to achieve is for the user assigned to the VTEST-3946 test.security fields Issue to be able to easily see what status the VTEST-3947 CLONE - test.security fields Issue is on. Because there is no link between the 2 Issues that information is not readily available. The idea is that the user I mention does not ever have an action for 3947 CLONE - test.security fields Issues, but knowing the status of that Issue is important for the project.

The link type I am trying to achieve is VTEST-3947 CLONE - test.security fields  relates to (outward) VTEST-3947 CLONE - test.security fields.

 

I've definitely gotten myself in quite the dilemma with this workflow situation. Really appreciate your insight here.

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 7, 2020

Hi Michael,

in that case, the easiest is probably to use a "post-creation script" on the Create/Clone Issue(s) post-function. Something like this:

issue.getLinkedIssues("relates to (outward)").each{
if (it != newIssue)
it.linkIssue("relates to (outward)", newIssue)
}

Of course, you might want to select a different link type in the linkIssue() call.

MAG-II April 9, 2020

Hey David - 

This seems to have solved my issue! I will continue to test it out, but so far so good. The Issues I mentioned get linked wonderfully. Thank you SO much for your help here!

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 9, 2020

Glad it worked.

Can you "accept" the answer so that other people can more easily find it in the future?

0 votes
Teja July 1, 2021

Hi @David Fischer 

I would like to know how to do this using script runner or Groovy code?

Thanks

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 1, 2021

Hi @Teja ,

you mean without JMWE? That would require much more Groovy code, using Jira's Java API. A ScriptRunner expert should be able to help you with that.

Regards,

David 

Like Teja likes this

Suggest an answer

Log in or Sign up to answer