How to get the jira issue key while importing?

Hi,

I need to get the new issue key right after it is created. How can I do that?

Cheers,

Petya

8 answers

1 accepted

This widget could not be displayed.

Here is what I did:

I created my new class that inserts the needed data in the help database. Then I called from DefaultJiraDataImporter.

Index: DefaultJiraDataImporter.java
===================================================================
--- DefaultJiraDataImporter.java	(revision 427)
+++ DefaultJiraDataImporter.java	(working copy)

;
@@ -714,6 +717,13 @@
 
 				try {
 					if (createIssue(externalProject, externalIssue, assignees) != null) {
+                        // We need to patch here to update the redirection table.
+                        try {
+                            InsertData.InsertDataForLinksRedirection(externalIdToIssueKey.get(oldId), oldId);
+                        } catch (final SQLException e) {
+                            throw new SQLRuntimeException(e);
+                        }
+                        // end.
                         stats.incrementCreated();
                     }
 				} catch (final ExternalException e) {



This widget could not be displayed.
Timothy Chin Community Champion Feb 25, 2013

Huh? What are you doing and what are you planing to do?

This widget could not be displayed.

I develop a Savannah importer plugin as a part of your JIM plugin. What I need to do is to insert into a table the old and the new issue key. Then I want to create an automatic redirection on the Savannah site to the migrated issue in JIRA.

This widget could not be displayed.

Where do you want to get it? What do you want to use it for?

This widget could not be displayed.

Where do you want to get it? What do you want to use it for?

This widget could not be displayed.

Actually, I need the URL of each issue. I want to do a redirection from Savannah to JIRA. For that purpose I have to store somewhere the two URLs. I have already the external URL, but I don't know how to get the new one.

This widget could not be displayed.

So you could actually run a search afterwards and get the External System ID and Issue Key, that would allow you to match them. No need to do that in the importer itself.

Do you mean to search in the database? If yes, it won't work because we have a few JIRA instances. That is why we need the links to be stored during the import. So, is there a way to get the issue key and/or issue link?

No it the database directly, just to use Issue Navigator. I believe there's no other option currently.

In case of projects (and others, except issues unfortunately) there's actually a callback that your plugin can implement - there's ImportDataBean.getCallbacks and there are several callbacks you can implement. There's afterProjectCreated callback as well.

I'm going to add afterIssueCreated callback, it will be released in JIRA 6.0

What about the project key?

This widget could not be displayed.

Here is what I did:

I created my new class that inserts the needed data in the help database. Then I called from DefaultJiraDataImporter.


Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

82 views 1 0
Join discussion

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