How to import issue and maintain Issue #?

Blargo July 1, 2013

I would like to import issues from our old system into JIRA. We would like to maintain for the initial import, the old Issue # and not have JIRA re-assign.

Any real feasable way to do this?

If we import, it does re-assign, can we run a SQL statement safely to set the #'s correctly from the external issue ID custom field?

Thanks!

4 answers

1 accepted

1 vote
Answer accepted
Pawel Niewiadomski
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 1, 2013

It's not possible when importing FogBugz. You can use CSV or JSON importer to set Issue Key while importing the data.

Either you manually update jiraissue table and run re-index afterwards (it's that simple) or modify source code for JIRA Importers Plugin's FogBugz Importer - IssueTransformer class and call externalIssue.setKey.

1 vote
Justin Alex Paramanandan
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 1, 2013

I believe that issue keys created as a result of the import can't be monitored as a result of concurrency of data being imported. Think of it as a race condition:

  • ORDER IN FOGBUGZ - A, B, C, D, E
  • ORDER AFTER IMPORT TO JIRA - A, C, D, B, E

Cases as this may be caused by the data within the Fogbugz issue itself; in the example above, maybe issue B has more data (comments, longer description etc) than A, C and D. I recall performing a test import from Bugzilla before, and in some cases, it turned out that way.

How about creating a custom field to store the Case ID ixBug Fogbugz field? Make it searcheable, map it during the import, and you can search for the imported issues in the Issue Navigator.

0 votes
Blargo July 1, 2013

The Import Plugin automatically creates the External Issue ID custom field for me on import, and it does appear to be a text custom field type as suggested by David / Pawel.

What I am ideally wanting to do is set the JIRAIssue.pkey column to be the same as the External Issue ID.

UPDATE j SET j.pkey = p.pkey + '-' + c.STRINGVALUE
FROM jiraissue j 
INNER JOIN customfieldvalue c ON j.ID = c.ISSUE AND c.CUSTOMFIELD = 10102
INNER JOIN project p ON j.PROJECT = p.ID

However, I know and understand that updating the database directly (and not through the app or API) is never a good thing, so I would like to do it the proper way. :-)

If the JIRAIssue.pkey is just a "pretty display" column, different then the JIRAIssue.ID column, what might happen?

Thanks again!

Keith

0 votes
David Pinn
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 1, 2013

As Pawel wrote, you would be better off using a text custom field type.

Blargo July 1, 2013

The Import Plugin automatically creates the External Issue ID custom field for me on import, and it does appear to be a text custom field type as suggested by David / Pawel.

What I am ideally wanting to do is set the JIRAIssue.pkey column to be the same as the External Issue ID.

1
2
3
4
UPDATE j SET j.pkey = p.pkey + '-' + c.STRINGVALUE
FROM jiraissue j
INNER JOIN customfieldvalue c ON j.ID = c.ISSUE AND c.CUSTOMFIELD = 10102
INNER JOIN project p ON j.PROJECT = p.ID

However, I know and understand that updating the database directly (and not through the app or API) is never a good thing, so I would like to do it the proper way. :-)

If the JIRAIssue.pkey is just a "pretty display" column, different then the JIRAIssue.ID column, what might happen?

Thanks again!

Keith

Suggest an answer

Log in or Sign up to answer