Forums

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

When importing Test Cases from .csv file. Can I link to another issue (user story)

Neil Etuati
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!
August 6, 2019

Hi,

I'm trying to import test cases in bulk. I can do this, but I want to link each test case to a User story but there seems to be no mapping for Issue links.

Is functionality not available yet?

If i export test cases that are linked to a user story the link appears in a column named. Outward issue link (Test), but this also doesn't exist in the import mapping.

Any suggestions or answers would be great.

Cheers

2 answers

0 votes
Heenaben Sardarbhai Chaudhary
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 1, 2024

Hi @Neil Etuati ,


I'm not completely sure if there's an existing feature for this, but you can definitely achieve it with APIs. I actually have a script that performs a similar task, so I thought I'd share it with you.

Quick Summary: This script takes an Excel file with your issue link data and interacts with the Jira API to create those links. It also adds a brief delay between requests to help prevent any issues with API rate limits, which is quite useful.

Here's How It Works:

  • Excel File: Ensure your Excel file (e.g., issues.xlsx) is set up with columns like InstanceLink, linkType, parentIssueKey, childIssueKeys, and API_TOKEN. You can use the template provided in the repository for reference.
  • Running the Script: Once your Excel file is ready, you just need to run the script using node start.js issues.xlsx. The script will then link each child issue to its respective parent issue as outlined in your file.
  • Error Management: If any issues arise, such as missing data or API errors, the script will log a warning but continue processing.

A 100ms delay is built in between API requests to avoid triggering Jira’s rate limiting, so you don’t have to worry about some links failing due to too many requests being sent too quickly.

You can find the repository here.

And while we’re on the subject of automation, if you’re looking to simplify your test case creation and linking process, I’d recommend checking out Test Case Assistant for Jira. This tool helps you automatically generate and attach test cases to user stories with a single click. It even uses AI to generate these test cases based on the specifics of your user stories, making the process both smoother and faster.

Whether you’re managing a few test cases or handling a larger workload, this tool can really streamline your workflow. If you’re interested, feel free to explore the documentation or get it from the marketplace.

0 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 8, 2019

Hello Neil,

Welcome to Atlassian community!

I understand that the test cases you are using are linked using the default issue linking of JIRA and you just need to import them through CSV linking directly to their relative Stories, Is it correct? Or is it using any other kind of link functionality provided by a third-party app?

Presuming it uses the Jira default linking functionality, the process for importing Issue Link through CSV is similar to importing of Sub-tasks, as described in Importing Data from CSV: one column must be mapped as Issue ID and the other as the desired link type (e.g. "Link 'relates to'"). The 'Link' column needs to have a value corresponding to the other issue 'Issue Id' value, or it needs to be an issue key of an already existing issue within the JIRA instance to which the data is being imported. For example:

 

Summary,Issue Id,Link One,Link One,Link Two
House  ,       1 ,       2 ,       3 ,       2
Patio  ,       2 ,        ,        ,
Garden ,       3 ,  TEST- 1 ,        ,

The file above would create three issues with correctly created issue links:

  • Issue 'House' will have three links:
    • Two links of type "Link One" to issue 'Patio' and 'Garden'
    • One link of type "Link Two" to issue 'Patio'
  • Issue 'Garden' will be linked to issue with key 'TEST-1'

For more information about the steps above, please check the documentation below:

How to Import Issue Links from a CSV File

Let me know if this information helps. 

Suggest an answer

Log in or Sign up to answer