xmunoz / bugzilla2gitlab

An issue migrator
MIT License
32 stars 19 forks source link

Is it possible to use the original bug id as issue id? #27

Closed abbbi closed 3 years ago

abbbi commented 3 years ago

hi,

short question: is it possible to migrate the bugs "as is", means sepzilla bug id 10 will become issue #10 in gitlab? Or is there a limitation on gitlab api site? Providing the tool with a list seems to re-number the issues (starting from 1)?

xmunoz commented 3 years ago

No, there is no way to control the gitlab issue number from the API.

abbbi commented 3 years ago

hi,

No, there is no way to control the gitlab issue number from the API.

i think it works with the latest version. An "iid" parameter was created which allows to do so, example:

curl -k --request POST --header "PRIVATE-TOKEN:token" "https://srv/api/v4/projects/2/issues?title=Issues%20with%20auth&labels=bug&iid=30

the api will end up creating issue with id #30 instead of auto-assigning. Probably introducing a config option for this would be neat, im going to give it a look next week.

xmunoz commented 3 years ago

Ah, I see: https://docs.gitlab.com/ee/api/issues.html#new-issue

When I wrote this several years ago it was using an older version of the API. I have not done any major upgrades since. That said, feel free to send a PR along that adds support for this.

abbbi commented 3 years ago

Unfortunately its a bit more complicated. It seems iid is ignored if sudo is set during post request. The API is still auto-assigning issue ids then. Removing the sudo flag during issue creation it works with preset id :/

Update: works if the users which are mapped are set as project owners while migrating the tickets, otherwise api silently ignores the iid setting.

xmunoz commented 3 years ago

Fixed by #28