I'm in the process of migrating WheelCMS's issue tracker from redmine to Github. The issues in redmine are numbered up to about number 800 (shared with many other trackers, there aren't that many WheelCMS issues yet :) and if I start "fresh" in Github, older commit messages will start referring to the new, irrelevant Github issues.
So I need to make sure that, somehow, new Github issues will start at, around, number 800. There's no way to tell Github to start at a certain number so the only option is to create empty (closed) issues.
The code to create the issues looks as follows (really simple actually):
from github import Github
username = "xxx"
password = "yyy"
organization = "wheelcms"
repo = "wheelcms_axle"
limit = 800
milestone = 1
gh = Github(username, password)
authuser = gh.get_user()
nameduser = gh.get_user(username)
organization = gh.get_organization(organization)
repo = organization.get_repo(repo)
milestone = repo.get_milestone(1)
issue = repo.create_issue("Placeholder issue", "This issue was originally created in an internal tracker and has not been migrated to Github.", milestone=milestone)
if issue.number >= limit:
In this case the issues are assigned to Milestone "1" which I've created through the web, but you could also do this using the same API of course. If you also want to assign the issues to a user, use the "nameduser" as name argument to create_issue.