I'm currently learning how to migrate projects from one collection to another and I'm using the VSTS-Sync Migrator tool to do the job.
I have this one work item that has a link to a branch in a repo (it is not a link to a git commit) and after running the migrator tool/script the same work item at the destination project contains everything but the git branch link.
-> I made sure to migrate the code prior to migrating the work items.
-> I am able to manually attach the same link in the migrated work item.
-> PAT token has full access
I've attached pictures of the issues below, the last time I asked a question on StackOverflow the pictures did not make it on so I will also add a description of each picture.
IMG 1: This is the warning message from the migration script. It says:
Cannot determine repository type from external link: vstfs:///Git/Ref/.....some link....
IMG 2: This is the migrated work item and under "Development" it shows an exclamation mark with the following message:
Branch not found or no permission to access it.
IMG 3: This is the work item at source.
When you migrate the work item, each of the Git commit links are mapped to the new Git repo as per the mapping that you have specified in the config file.
The reason that you get the error is that the Branch link is migrated as is and has not been mapped to the new Repo. I think this is an oversight in the migration tools and you should submit a pull request to https://github.com/nkdAgility/azure-devops-migration-tools that includes the fix.
Check: https://nkdagility.github.io/azure-devops-migration-tools/