How to Automatically link an issue to an existing issue

We have a new issue type by name TestCase.

When a user creates a new TestCase issue from a UserStory, is there a way to automatically Link it to a UserStory with out the user manually doing it .



3 answers

0 votes

There are plugins that can do it but it is not possible on onDemand instance.

0 votes

Three things.

1. You need to think this through - how does a "user create a test case from a user story"? You need Jira to understand when they are doing this, which implies a workflow process or new option to do it as an action (like "edit", "comment" etc). Either way, you can then tag code into that process to do the linking

2. You can't install the plugins/code you might need to do this in OnDemand (and you'll probably have to write it yourself)

3. Have you looked at "subtasks"? Those are automatically linked to their parent.

Thank you Nic for your quick response.

Since we are using OnDemand, I believe we can't create an "Create Test Case" action button like "edit" and "commit". But you have mentioned that cab write this code myself. Is there any sample code available for similar functionality available where I can use it as a reference

Also for a typical software development environment, is Test Case is created as a Sub Task of User Stroy? Is that the best practice recommended by JIRA?

You're missing the point in answer 2 - you can't install plugins or code on OnDemand.

Some people create test cases as sub-tasks under an item, I find it quite a clear and logical way to work. Others don't. It's more up to your processes and way of working - I can't give you a clear cut "yes, it's the best way to do it" here.

This can be achieved using the 'Create issue link' post function and would only work as long as the issue is created within the Epic or linked to the related Epic using the ‘Epic Link’ field during creation.

In my case, i wanted any new story issue type to be automatically linked to the Epic using the 'blocks' option from the 'Issue Linking field during creation.

In the 'Create' transition, select the post function (Create issue link)

From the Issue s to be linked parameter, select the 'Field containing issue keys' option and in the dropdown,  Keys of linked issues

image2015-6-4 12:57:44.png

From the Issue link type to be created, I selected the 'blocks' option. You can select any option depending on the linking that is required.

image2015-6-4 12:58:12.png

Click on the Add button.

Don't forget to select the 'Publish Draft' button to save your changes

image2015-6-4 12:58:49.png


Hope this helps.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,719 views 17 21
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you