Shallow copy of Github issues between two private repos

We are starting a new issues-only repo for customer bug-tracking. Previously they reported issues by email and I entered them in our code repo issues, now we want to migrate these to the public issues repo so they can see them, without manually re-entering.

In nutshell what we want to do is:

  • For every issue X labelled ABC in Repo1:

    • Create a new issue X’ in Repo2 using the title and original post (including images) from X
    • Comments, Milestones, Assignees, Labels on X are not needed in X’
    • We do need a reference between the two issues
    • We don’t want to alter X e.g. close it, other than linking it to X’

It seems like if I was experienced with the APIs I could do this quite simply but I’m just not used to the API or Linux enough to be confident - and none of the tools I’ve found online offer the flexibility needed. Can someone offer me any advice on this?

To add, thre are ~100 such issues. I can run a script manually 100 times but I don’t want to run a tool like 100 times and fix all the side-effects!

Since I’m not a Linux expert, I was considering something like

Personally, I think the GitHub API would be the easiest way to do this. However, to make it easier, I would recommend checking out Octokit which are a family of frameworks for using the GitHub API programmatically.

I’ve seen mixed information online about whether v3 API allows copying an issue text including images?

Can you give me any suggestions how I can do this and if it is particularly complicated or not? If it’s going to take more time to figure this out than to manually migrate a 100 issues, I’d be better finding a data-entry person to do the work, annoying as it is!

Hi @jdx-john,

The v3 API will return a string of the body when you use the Get an Issue API endpoint. The Create an Issue API endpoint allows you to set a string as the body parameter, so you can directly copy the content from one Issue to a new Issue.

Did you take a look at the Octokit link? I can help you figure out the basics of the script that you would need to create, but I will need to know which flavor of Octokit you want to be using.