Tech | Product | Management

How to Bulk Create Issues in GitHub

Scott Jackson
3 min readSep 21, 2020
Photo by Richy Great on Unsplash

This last week, my team and I needed to jumpstart a new project we’re managing in GitHub/ZenHub. As I started working one-by-one down my list of 70 tickets I was supposed to create, I thought to myself: “There has to be a better way.”

Thanks to Gavin Rehkemper, there is. We used his GitHub CSV Tools to upload 70 tickets, complete with labels, descriptions, and assignees, in about 2 minutes. Here’s how we did it.

Create a Dataset of Issues

  1. Create a new spreadsheet. Ultimately, you’ll be converting this into a CSV, so keep it simple.
  2. Add the following column headers:
  • “title”
  • “description”
  • “assignee”
  • “state”
  • “milestone”
  • “labels”

3. List the tickets you’d like to create and enter the info you’d like added to each. Keep in mind the following:

  • Don’t add carriage returns/new lines to any of these fields. This can limit what you add to descriptions through this method, but if you really are creating issues in bulk, you can easily go back through tickets later and add what you need to.
  • To add multiple labels, assignees, or milestones to a single issue, separate each with a comma.
  • Any labels you list in this dataset that aren’t already in your GitHub repository will be created through this bulk upload. While you can add labels to your GitHub repository ahead of time, you can also use this process to create them in bulk. In fact, if you need to create a lot of GitHub labels you could just create a fake issue, add all the labels in the labels field, upload it, and then save yourself some time.
  • For the most part, you’ll want to set “state” to “open” for every issue. If for some reason you have a need to create closed issues, set “state” to “closed”.
  • This method does NOT allow you to bulk create issues based on issue templates you may have implemented in your repository. Again, like above, just creating bulk issues all at once can save enormous time and then you can easily go back through tickets afterward and add anything you need from templates.

4. Save your spreadsheet as a CSV.

Setup GitHub CSV Tools

  1. If you haven’t already, download and install Node.js.

2. Install the GitHub CSV Tools service using this code in your command line utility:

npm install -g github-csv-tools

3. Generate a new token in GitHub:

  • This walk-through assumes you already have a username setup in GitHub. If not, do that now.
  • This walk-through also assumes you’ve already created the repository you’d like to upload issues into. If not, do that now too.
  • Go to https://github.com/settings/tokens
  • Select “Generate new token”.
  • You may need to re-enter your password.
  • Check the box next to “repo” to select all options to allow edit of your repositories.
  • After the token is generated, keep it handy. You’ll need this in a sec.

Upload Issues

  1. Copy the filepath of the CSV you created earlier.
  2. In your command line utility, enter:
githubCsvTools myProjectData.csv

… replacing “myProjectData.csv” with the filepath you’ve copied.

3. You’ll next be prompted to enter your GitHub token. Copy this from GitHub and paste it in your command line utility.

4. Next, enter the user or organization that owns the repository you’ll be uploading to.

5. Finally, enter the repository name you want to bulk upload issues to.

6. Wait for a moment while your issues are uploading. Depending on the number of issues you’re uploading, this could take a bit of time. When it’s complete you should get a message something along the lines of:

Created 70 issues, and had 0 failures.

7. Go into your GitHub repository and inspect your issues to make sure everything uploaded as expected. You may also want to look at your list of Labels to make sure you created or used labels as planned.

Good luck!

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Responses (3)

Write a response