Just a heads up, if you have the -gh_update_assigned_to
flag set to $true
, you/your users will receive a lot of emails.
- Install az devops and github cli where this is running (ie: action or locally; GitHub-hosted runners already have)
- Create a label for EACH work item type that is being migrated (as lower case)
- ie: "user story", "bug", "task", "feature"
- define under what area path you want to migrate
- You can modify the WIQL if you want to use a different way to migrate work items, such as [TAG] = "migrate"
- Title
- Description (or for a bug, repro steps and/or system info)
- State (if the work item is done / closed, it will be closed in GitHub)
- It will try to assign the work item to the correct user in GitHub - based on ADO email before the
@
- This uses the
-gh_update_assigned_to
and-gh_assigned_to_user_suffix
options - Users have to be added to GitHub org
- This uses the
- Migrate acceptance criteria as part of issue body (if present)
- Adds in the following as a comment to the issue:
- Original work item url
- Basic details in a collapsed markdown table
- Entire work item as JSON in a collapsed section
- Create a comment on the Azure DevOps work item that says "Migrated to GitHub Issue #"
- Created date/update dates
The recommendation is to use a GitHub App to run the migration - a GitHub app has higher rate limits than using a user PAT.
- Create GitHub App with (can use this reference). Use the following permissions:
- Repo:
Contents:Read
- Repo:
Issues:Read and write
- Org:
Members:Read
- Repo:
- Create Private Key for GitHub App
- Obtain App ID and Installation ID - see the instructions for using smee.io
- Create the following action secrets:
ADO_PAT
: Azure DevOps PAT with appropriate permissions to read work itemsPRIVATE_KEY
: The contents of the private key created and downloaded in step #2
- Use the action and update the App ID and Installation ID obtained in step #3
- Update any defaults in the action (ie: Azure DevOps organization and project, GitHub organization and repo)
- Ensure the action exists in the repo's default branch
- Run the workflow
Using the GitHub app might be better so you don't reach a limit on your GitHub account on creating new issues 😀
./ado_workitems_to_github_issues.ps1 -ado_pat "xxx" -ado_org "jjohanning0798" -ado_project "PartsUnlimited" -ado_area_path "PartsUnlimited\migrate" -gh_pat "ghp_xxx" -gh_org "joshjohanning-org" -gh_repo "migrate-ado-workitems" -gh_update_assigned_to $true -gh_assigned_to_user_suffix "_corp" -gh_add_ado_comments $true