How to import issue link - (relates to) via CSV

rashmi February 17, 2015

hi 

Is JIM upgraded to import issue links via CSV ? I am interested in importing 2 items with 'relates to' issue linking between them. (I looked at the available faq in the forum, but did not find any option other than jelly)

Please help.

3 answers

1 accepted

8 votes
Answer accepted
pborkowski
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.
February 18, 2015

Hey,

It's possible - we have just release to marketplace JIM 6.2.20 which allows to import/create Issue links via CSV. It's available for both CSV admin and non-admin importer. You can install this version of JIM to JIRA 6.2+ and it will be by default bundled with JIRA 6.4+

I'm afraid we do not have available docs for this process yet, but it's really similar to import of SubTasks: You need to map one column as Issue ID, and the other as desired link (e.g. "Link 'relates to'"). The 'Link' column need to have a value corresponding to other issue 'Issue Id' value or it needs to be an issue key of already existing issue. 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'
Udo Brand
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.
February 18, 2015

I didn't expect it so soon: +1

0 votes
rashmi February 18, 2015

hi

I have two existing issues [ RJM-169 (Foo-1) and RJM-170 (Foo-2) ]. My import csv has

SummaryIssue IdBlocks
Foo-1RJM-169

RJM-170

After the import, my expectation is to see both RJM-169 and RJM-170 are showing issues links 'blocks' to each other. But instead, a new item RJM-171 is created, which has RJM-169 as External ID and RJM-170 as the 'Blocked' link.  Please help to understand this better.          

My requirement is to create links between EXISTING ITEMS ONLY. I don't want to create new items.

image2015-2-19 16:12:33.png

thanks

R

pborkowski
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.
February 19, 2015

Unfortunately the non-admin CSV Importer is securely designed and it only allows to create new issues. If you'd like to update existing issues, you will need to use the admin CSV Importer available in External System Import menu in system settings.

rashmi February 19, 2015

Hi, I am using the admin External Importer. Is there anything else that I may be missing ?.

Like msi72805 likes this
pborkowski
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.
February 19, 2015

In that case, CSV Importer identifies the issue that you'd like to update by Issue Key mapping. If your CSV file looks like the table that you have posted in this answer then please map it this way: - Summary -> Summary - Issue Id -> Issue Key - Blocks -> Link 'blocks' This way imorter will update the issue that is pointed by 'Issue Key' mapping.

rashmi February 19, 2015

This worked great!! Thanks a lot. Could you please look and advice on this ticket JST-128657. I have received an answer but not accepted it yet.

Jordan M. Pflum July 25, 2017

Hello, regarding above:

 

Unfortunately the non-admin CSV Importer is securely designed and it only allows to create new issues. If you'd like to update existing issues, you will need to use the admin CSV Importer available in External System Import menu in system settings.

 

Is this still the case? 

Nikhil February 4, 2020

Jira currently only allows the import of outward link descriptions. 

Here's a feature request created for the ability to import inward link descriptions implemented in Jira Server application:

CSV Importer should allow users to choose to import Issue links as Outward or Inward Description

Please vote.

Günter Halmans April 30, 2020

Hi Nikhil,

I had the same challenge some times ago regarding "Inward" and "Outward". And I found a simple solution (in case I have understood your question correctly ;-):

Assume you have the two Jira projects "A" and "B" and in A issue "A-1" and in B  issue "B-1".

1. Use Case

If you want to import a link between A-1 and B-1 in the sense "A-1 contains B-1" the csv-file should look like this:

IssueKey ;LinkKey ;Summary
A-1; B-1;

In the "External System Import" you would select the file and - important - the Jira project "A". That is because Jira generates the link as parent-relationship of the linktype "Story" into the issues of A (in this case A-1). As mentioned in the other contributions the import of the links is only possible in one direction: parent -> child. The result of this import would look like this:

  • A-1 contains B-1 (in the detailed view of A-1)
  • B-1 is part of A-1 (in the detailed view of B-1)

2. Use Case

Let us now assume you would like to come the other way around. You are working or thinking about B. You have imported the issue B-2 and B-3 somehow (without link). And you would like to import the link between B-2, B-3 and A-1 in the sense of: "B-2 is part of A-1" and "B-3 is part of A-1". That seems to be not possible because it looks like a child relation from B-2, B-3 point of view. And as mentioned before in Jira currently only "parent"-relations are importable. Maybe you think about an import file like this:

IssueKey ;LinkKey ;Summary
B-1; A-1;
B-2; A-1

And during the "External System Import" you would choose the file and the Jira project B because you would like to update the B-issues. During the assignment of the fields from the file to the Jira project you use "IssueKey -> Issue Key", "Summary -> Summary", and "LinkKey -> Link Story". Jira would generate the following links after such an import: "B-2 contains A-1" and "B-3 contains A-1" or the other way around (when you look in the detailed view of A-1): "A-1 is part of B-2" and "A-1 is part of B-3".

That is not what you aim at in this use case.

The trick is to use the same perspective as explained in use case one: you should define a csv-file like this:

IssueKey ;LinkKey ;Summary
A-1; B-2;
A-1; B-3;

During the "External System Import" you now select the appropriate file and the project "A" (and NOT "B") to import the links. With "IssueKey -> Issue Key", "Summary -> Summary", and "LinkKey -> Link Story" Jira now would generate the following links:

  • A-1 contains B-2
  • A-1 contains B-3

or according to the other direction (looking in the views of B-2, B-3):

  • B-2 is part of A-1
  • B-3 is part of A-1

That is what we wanted ;-)

Of course this way only works in case one has the needed edit-permissions in project A.

When I have the task to import several linktypes I always import them separately because this is the easiest way. But to be honest I haven't got the challenge to import more than one or two linktypes to a specific set of issues.

I assume that the mentioned way is documented somewhere in the Jira community...but with this reply you do not have the necessity to search for it :-)

Hope that I could help you with my "story",

kind regards.

Günter

Carolyn Nelson March 3, 2021

Thank you for your detailed reply.  I am still unclear about one thing which is how I tell the import which link type to use.  I plan to create a parent task first (A-1) and then create a large quantity of other ticket types (B-1, B-2, etc.) that I want to link to the A-1 parent using the "is a child of" link type.  So I'm thinking I have a column in my csv (viewing it in excel as columns) that has the heading Issue Key:Link Key -- or are these separate columns?  I would enter the data as either:

A-1:B-1 (if one field) or A-1  and then B-1 in the Link Key field if these are two separate columns?

And then what column heading do I use to indicate the link type "is the child of"?

Thank you.

Günter Halmans March 3, 2021

Hi Carolyn,

according to your example your excel-file should look like this:

import_links.png

The order of the columns is not relevant.

Column A contains the issuekey of the parent issues (A-1, A-2, ...). Column C contains in this example the issuekeys of the issues which should be linked to A as child issues during the import.

Column B contains the summary...which should be empty. In case it is empty, the current summary of the A-issues will not be impacted. I don't know the reason why Jira needs a column "summary", but I guess it has something to do with the mandatory character of this field.

After saving the excel file in a csv-format, you will be able to import the file via the External Import Function (administration/system).

During the different steps of the import process (e.g. selecting the import file, selecting the delimiter if it is not "," etc.) it is important to choose the Jira project A which contains the "parent issues". The links are always inserted from this parent perspective and thus you have to choose the A-project.

In the dialog for assigning the fields you then should conduct the following assigments:

1. issuekey --> issuekey

2. summary --> summary

3. link-key --> Link "YourLinkType"

In our system we for example have defined the following link types which are presented in the corresponding selection list:2021-03-03 16_31_18-External System Import - Jira.png

And after selecting the appropriate link type (in my case "Story") the dialog should look like this:

2021-03-03 16_34_21-External System Import - Jira.png

After confirming the import step the links should be created and visible in the parent as well as in the child issues (but of course with the appropriate direction name).

Hope, this short description helps a bit.

Best regards and good luck,

Günter

PS: I made good experiences with importing test files with only two or three data sets first. Then I checked the link directions and afterwards I imported the whole file. It is reasonable because it is not so easy to delete links via bulk change...

Carolyn Nelson March 3, 2021

Thank you so much for your reply and the screen captures.  Both parent and child issues will be in the same project, which is specified in the cfg file I have created.  So do I have to include a Project column?

This is going to be an ongoing process which will happen once a month in which we will create the parent issue (which in our case is a Task) and then we will import a dozen or so items (inquiries) and I am hoping to import all of the fields, including Summary AND create the link to the parent at the same time. 

So I assume the Issue Key will be the Key of the Parent Task --the same Issue Key will then appear in each row for each new child issue.  The system will be assigning a new Key to each of the child issues being imported.

I will test it out to see what the import tool offers in our system for the link types.

Do you see any issues with this procedure?

Günter Halmans March 4, 2021

Hi Carolyn,

no, you don't have to include a Project column.

In case parent and children are in the same project, the mentioned principle is still valid. In this case the Jira project which you have to choose for the import (in the import dialogue) is the one which contains parents & childrens. So you will not get in trouble because of choosing the wrong project ;-)

The corresponding excel-file could look like this (in case of parent and children are in the same Project A):

2021-03-04 08_33_03-Mappe1 - Excel.png

After the import of such a csv file and using the link type you have mentioned, in the detailed view of issue "A-2" you would see in the section "Issue Links":

is child of...
A-1 <parent issue>

The same for A-3 and A-4. In A-9 and A-22 you would see analogue the reference to A-13.

Assumed, that the other direction of your link type has the name "parent contains", you would see for example in the detailed view of A-1 the following issue links:

parent contains...
A-2 <child issue>
A-3 <child issue>
A-4 <child issue>

The term "<child issue>" represents here the summary of the specific issues.

That is the way I would solve your request.

Best regards,

Günter

0 votes
Udo Brand
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.
February 17, 2015

Currently not possible, but soon, see https://ecosystem.atlassian.net/browse/JIM-640

Suggest an answer

Log in or Sign up to answer