Search code examples
gitlabgitlab-api

When creating an issue through gitlab api set a specific issue number


We are trying to migrate our old issue "tracking" system to GitLab.

For legacy reasons the issues have relatively large numbers 800 and above and they are not consecutive.

However for backreference it would be great if we could have one number for each issue and not an "old" and a "new" number, as in some contexts issues are referred to by number (e.g. external parties who in the future also will use GitLab)

I found this Set Minimum Issue Number in Gitlab where issues were created to "fill" the gaps. However this creates a lot of clutter (especially E-Mails Gitlab API - Create issue quietly?).

Any ideas how to solve this?

The ideal flow would be:

  • use gitlab-api to create issues we have and
  • add a parameter so set the number of the issue.
  • When using gitlab, the numbers are filled up by new issues over time, or they count up from the highest issue number currently in the project.

If I could actually set the issue number afterwards in the database (as was hinted in the linked question above), how will gitlab handle this? (I don't even know where to start looking in the gitlab code base, any hints on that might also answer this question).

Thanks in advance for any advice on how to tackle this.


Solution

  • I found a trick to do that.

    There is exporting to .csv from the GitLab and .csv is an editable format. It can be edited in any excel-like program, or even in a notepad.

    Make a first issue, fill it with dummy data (I suggest filling as that's a way to spot which field is responsible for what).

    Then fill your data by any way suitable, preferably mass-exported from the previous issue tracker and import back to the GitLab.

    If done correctly, this should be possible to be done partly automatically.