Utilities to migrate GitHub issues to Jira
Largely inspired by the blog How to migrate GitHub issues to Jira by @zmcddn
-
Install Python dependencies:
python3 -m pip install requests argparse
-
Rename and populate the following template files:
migrationutils.py
- Authentication variables for GitHub and Jiraconfig.json
- Configuration for GitHub issue label filtering (Aconfig.json
can be renamed toconfig\_\*.json
if you want to reserve unused configs for later but not track them in Git.)user_map.json
- Mapping of GitHub users to Jira users (this can alternatively be supplied using theuser_map
key inconfig.json
or not supplied at all if user mapping is not desired.)
Invoke the script using the Python CLI. Use arguments to override the config.json
file, display verbose logging, or
run a dry run:
NOTE: Running with --dry-run
and/or --dry-run -v
prior to migration is highly recommended. While the output is
long, you'll be able to verify data that is being passed to Jira.
$ python3 jira-migration.py --help
usage: jira-migration.py [-h] [-l LABEL_FILTER] [-e LABEL_EXCLUSIONS]
[-c COMPLETION_LABEL] [-s SQUAD_COMPLETION_LABEL]
[-m COMPONENT_NAME] [-v] [--dry-run]
Utility to migrate issues from GitHub to Jira
options:
-h, --help show this help message and exit
-l LABEL_FILTER, --label-filter LABEL_FILTER
Filter issues by GitHub label (comma separated list)
-e LABEL_EXCLUSIONS, --label-exclusions LABEL_EXCLUSIONS
Exclude issues by GitHub label (comma separated list)
-c COMPLETION_LABEL, --completion-label COMPLETION_LABEL
Label to filter/add for issues that have been migrated
-s SQUAD_COMPLETION_LABEL, --squad-completion-label SQUAD_COMPLETION_LABEL
Label to filter/add for issues that have been migrated
for non-closeable issues
-m COMPONENT_NAME, --component-name COMPONENT_NAME
Name of the squad or component for messages
-v, --verbose Print additional logs for debugging
--dry-run Only run get operations and don't update/create issues
These scripts use some specific label filtering for my use cases. Here are some pointers if you're modifying for a different use case:
- Update
root_url
injirautils.py
- Update
project_key
,security_level
, and custom fields injirautils.py
- Update
org_repo
inghutils.py
- Update
workspace_id
inzenhubutils.py
- Look at the mapping flows in
migrationutils.py
(we heavily used labels in GitHub to specify things like priority and component)