Forums

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

How to import issues from Bitbucket with the next-gen project?

Gioid January 19, 2020

Hello,

these days I wanted to give a try to the new Jira free tier, because a few years ago I worked in a company that used it and I had a good feeling.

I am an old Bitbucket customer that I used from a long-time for my personal projects, so the first step that I tried was to import a Bitbucket repo's issues to my new Jira dashboard. I thought the process would be straightforward, instead I noticed immediately from the documentation that the old wizards have been removed from the new Jira versions so I followed these instructions (https://confluence.atlassian.com/adminjiracloud/importing-data-from-bitbucket-935384618.html). 

 

Even if I consider illogical to edit manually the JSON exported from the Bitbucket export (both appreciated Atlassian products), I gave it a try but I already knew that this would have brought me to strange errors. In fact, I struggled a lot and even if I simplify as much as I can the JSON, I receive the following error:

"Error importing issue [externalId='null', summary='Request for comment']: Status [ New ] does not have a linked step in the [ Software Simplified Workflow for Project TEST ] workflow. Please map to a different status."

 

Now, from the error message I think that I have to change something in the workflows, but I don't understand why there is nothing that works out-of-the-box for Bitbucket or at least a documentation that works.

 

Here below the JSON that I try to upload; where am I wrong? What I have to do?

 

{
"projects": [
{
"name": "test",
"key": "TEST",
"type": "software",
"template":"com.pyxis.greenhopper.jira:gh-kanban-template",
"milestones":[],
"attachments":[],
"versions":[],
"components":[],
"issues":[
{"status":"new","priority":"critical","issuetype":"bug","description_updated_on":null,"voters":[],"summary":"Request for comment","component":null,"watchers":[{"display_name":"Name Surname","account_id":"xxyyzz:kkkjjjj4-8ce9-4768-8f3e-734e12c2cb2d"}],"description":"Lorem ipsum‌","assignee":"xxx","created_on":"2020-01-16T10:24:04.592640+00:00","version":null,"edited_on":null,"milestone":null,"updated_on":"2020-01-16T15:05:46.998750+00:00","id":20}
]
}
]
}

 

2 answers

1 accepted

0 votes
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2020

Hello @Gioid ,

The problem here is that you are trying to import the issue in "New" status but this status does not exist in the destination Next-Gen project workflow. 

The only 3 workflow statuses available in Next-Gen projects are:  "To Do", "In Progress" and "Done". Therefore, you may want to change the status from "New" to "To Do" and see if this solves your issue.

 

Then, in order to provide some more context:

1) Next-Gen projects are simplified version of the Classic projects with limited configuration possibilities and still under development that are intended to be used by teams without particular necessities that wanna start working without having to configure much. 

Therefore, please make sure that next-gen is the right kind of project for you and take into account that you may find missing functionalities. For more details please review below articles and the links in there:

 

2) At this point in time it is not possible to edit the workflows but we have the below feature request open in our system to have this possibility added:

You may want to vote and watch the above feature request so that you will get notified in case of any update. The  feature will be addressed according to the Implementation of New Features Policy.

 

3) If you have to import the BitBucket issues into a clean Jira Cloud, another option is to use the workaround listed in the below feature request:

 

I hope this helps.

 

Cheers,
Dario

Gioid January 21, 2020

Hello @Dario B,

thank you for your response and the links to the context.

When I created the test project, I did not mind to choose the Next-gen workflow because in the documentation it seemed to be not a problem for the Bitbucket import. If you could update the documentation it would be easier for us and we would require less active support from you.

 

Anyway, I voted for the issue that you linked to me, but I tried to use unsuccessfully the workaround found in the third point of your list: I converted my issues with the python script and tried to import the CSV mapping columns/fields, but I get many errors/warnings. I dig into it and I found that the script is no longer compatible with the JSON exported from Bitbucket Cloud, so I tried to fix it quickly.

 

As you said, the status "New" is not available on the Next-gen projects but the CSV importer is way more configurable than the JSON one. I still have problems with the issueType, because even if the wizard allowed me to map them, all the issues created are Tasks.

 

However, since this process is trickier than I expected to be, I imagine that the Bitbucket Cloud is not the main Atlassian's focus right now (even considering the absence of the converter from hg->git repository after the Mercurial dismission) and I was not missing a trivial link/wizard.

 

I accept your answer to help someone else understand that if you want to import issues from Bitbucket it's better to choose the CSV importer and be ready to script and manually adjust configuration on the Jira project.

Like Dario B likes this
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 22, 2020

Hi @Gioid ,

Thanks for your reply and for providing your feedback. 

In order to provide more context, the CSV import offers indeed the possibility to map the fields having invalid/unrecognized values to valid ones. However:

  • Make sure to use the CSV importer from the System Settings, under External System Import and not the one to bulk create issues (CSV importer) since the latter one is intended to be also used by non-admin users to bulk create issues (assuming they have proper rights) and therefore it has some limitations. See below links for the differences:
    1. Importing data from CSV
    2. Creating issues using the CSV importer
  • As you have already found out, the script to convert the JSON  exported from Bitbucket to CSV is outdated (last update in 2013) and it needs some manual adjustments. If you have fixed the script and you want to share it with the other users you may want to take over the existing project or create a new one, or paste the script in here.
  • The feature request for Jira I pointed to did not get enough traction (7 votes since August 2017). However the same feature request is tracked for the Bitbucket Cloud project and it has added to the "long term backlog" not too long ago: [BCLOUD-19617] Cannot migrate Bitbucket Issues to Jira using exporter/importer 

 

Cheers,
Dario

Gioid January 26, 2020

Hi @Dario B

the changes that I made to the script are minimal: I just fixed the issueType and "modifiedOn" field. I noticed that the reporter field is not working, so for this reason and because the comments/attachments are not easily importable, I am not able to take over the existing project.

 

However I am glad to share the two lines that I changed, to someone else maybe can find them useful to go ahead to fix the script. Starting from line 32, define the keyMapBukkitToJIRA as the following:

 keyMapBukkitToJIRA = {
u'status':u'Status',
u'content':u'Description',
u'title':u'Summary',
u'reported_by.username':u'Reporter',
u'updated_on':u'Updated',
u'created_on':u'Created',
u'priority':u'Priority',
u'metadata.component':u'Labels',
u'kind':u'Issue Type',
u'responsible.username':u'Assigned'
}
Like Dario B likes this
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 28, 2020

Thanks for sharing this @Gioid 

Like Gioid likes this
1 vote
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2020
Gioid March 1, 2020

Thanks for the update. I tried the new export from bitbucket and then I imported the new compatible JSON. Now it works and I think I just have to create the missing users in Jira. Now I can give it a try. 

Like Dario B likes this
harisshuaib
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 9, 2020

This still doesn't work for me. I'm still getting this issue with the JSON importer

Unexpected failure occurred. Importer will stop immediately. Data may be in an unstable state: An issue type with the name 'Bug' exists already.

Suggest an answer

Log in or Sign up to answer