2

My team is slowly migrating from Azure DevOps Org1/ProjectX to Org2/ProjectA. All of our work items are currently managed in Org1/ProjectX while our 100's repos and pipelines are individually migrated to Org2/ProjectA over several weeks. Throughout migration, we want to continue managing all work items in a single project, Org1/ProjectX.

After a repo is migrated to Org2/ProjectA, I want to link new branches to work items that live in Org1/ProjectX. How can I solve this problem?

What I have tried:

The Microsoft document Link to a remote work item shows the availability of link types Remote Related and Consumes From. I do not see these link types available in the drop down list.

I tried to enter the full URL of the remote repo in the Repository field of the link. e.g. https://dev.azure.com/Org2/ProjectA/_git/Repo99. The display shows "no items found".

I tried to enter the full URL of the remote work item in the Work items to link field of the branch. e.g. https:/Org1.visualstudio.com/ProjectX/_workitems/edit/25889. The display shows "no items found".

I also attempted a workaround:

I created a work item in Org2/ProjectA, e.g. https://dev.azure.com/Org2/ProjectA/_workitems/edit/242/. I then created a Remote Related link to a work item in Org1/ProjectX, e.g. https://Org1.visualstudio.com/ProjectX/_workitems/edit/25889/. Now I am able to link a branch to the local work item 242. I clicked Save. No errors. However, the Related Work section is blank in both work items 242 and 25889.

BillQ
  • 71
  • 1
  • 7

2 Answers2

1

I also have a situation where all the work items are in a separate collection and project from the code repository. A default check added for all Pull Requests is that they must be linked to Work Items. We have to ignore / bypass this check in order to complete the PR Merge.

Using the API's and a little more help from here: stackoverflow How to link a work item to a pull request using REST API in Azure DevOps? and here: Microsoft docs I experienced the similar results as BillQ.

I got a 200 success status code after executing the PATCH API, against the REPO with the Work Item, using the vstfs:///Git/PullRequestId/... artifact link for the Collection + Project with the code and pull request.

Through the TFS Web interface, I did not see a Work Item link on the Pull Request. On the Work Item, a User Story in this case, I saw a link under a grouping "Unknown link type to execute." The message for the link: "Pull Request not found or no permission to access it."

So, the link between the Pull Request and the Work Item was created, but at least the web interface will not display it. Also, the API to list Work Items associated with Pull Requests returns "count": 0, "value":[] items with a 200 success status code.

Attempting to execute the API to add the work item to the pull request again returns the error: "message": "Relation already exists."

Joe B
  • 692
  • 8
  • 18
-1

Organizations that use Azure Active Directory can link work items that exist in different projects across organizations.

You should make sure both of your organizations are AAD based.

For organization url, on September 10, 2018, Microsoft renamed Visual Studio Team Services (VSTS) to Azure DevOps Services.

VSTS features are now separate services:

enter image description here

For the url's change. We've moved to the new dev.azure.com domain name as the primary URL for new organizations. (Specifically, it's https://dev.azure.com/[your organization name].)

If you want to change your URL to be based on dev.azure.com as the primary, an organization administrator can change this from the organization settings page. We will also support redirects from visualstudio.com URLs so there will not be broken links.

For more information about this change, see Introducing Azure DevOps.

You could change the old url in Org1 https://Org1.visualstudio.com/ProjectX to the new dev.azure.com. Then check again if this do the trick.

enter image description here

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62