swingbit / jira2gitlab

Migrate Jira projects into a Gitlab instance
MIT License
20 stars 11 forks source link

jira-user-list.py doesn't seem to support Atlassian Cloud? #16

Closed ams-tschoening closed 1 year ago

ams-tschoening commented 1 year ago

I'm trying to import some issues of some projects into GitLab using your tool, because the default implementation of GitLab itself doesn't import comments etc. and seems pretty useless this way. The important thing to note is that I don't have JIRA on-prem, but in the Atlassian Cloud. When trying to read users I get the following error message:

root@potsdam:/opt/jira2gitlab# python jira-user-list.py

Get participants of GOERLITZ
[INFO] Loading Jira issues from project GOERLITZ ... 10

[INFO] #1/10 Looking at Jira issue GOERLITZ-1 ...   Traceback (most recent call last):
  File "/opt/jira2gitlab/jira-user-list.py", line 78, in <module>
    project_users(jira_project)
  File "/opt/jira2gitlab/jira-user-list.py", line 67, in project_users
    jira_users.add(issue['fields']['assignee']['name'])
KeyError: 'name'

Invoking the query in the browser works and provides the following object for one of the issues:

"assignee": {
    "self": "https://[...]/rest/api/2/user?accountId=60c[...]ac5",
    "accountId": "60c[...]ac5",
    "avatarUrls": {
        "48x48": "https://[...]FMM-1.png",
        "24x24": "https://[...]FMM-1.png",
        "16x16": "https://[...]FMM-1.png",
        "32x32": "https://[...]FMM-1.png"
    },
    "displayName": "Marek Maćkowiak",
    "active": true,
    "timeZone": "Europe/Berlin",
    "accountType": "atlassian"
},

The objects for author, reporter etc. look the same. So is your tool simply not compatible with that version of the API or Atlassian Cloud in general or ...? What should name contain, some username different from displayName and accountId?

I didn't find anything like such a username in the response. Though, the import dialog of GitLab seems to show displayName only as well and provides a mapping based on that to usernames in GitLab.

image

swingbit commented 1 year ago

The README states quite clearly that this whole project was written for Jira Server edition. Jira Cloud edition uses a different API and is not supported. Unfortunately I don't have the time to work on it right now.