Answers: <p>There are actually many ways to link work items to other objects in Azure DevOps.  <a href="https://docs.microsoft.com/en-us/azure/devops/boards/queries/link-work-items-support-traceability?view=azure-devops&amp;tabs=new-web-form#work-items-linked-to-git-code-development" rel="nofollow noreferrer">Microsoft's documentation</a> is pretty extensive on this topic.  However, for the particular task at hand, linking code commits (I'll assume Git is in use for this example), can be done in several different ways.</p>
  
  <ol>
  <li><p>In your commit message - By including the work item ID in the commit message prefixed with the hash mark <code>#</code> (i.e. <code>#12345</code>), when the commit is pushed to the server, the work item and commit are linked automatically.  Then, when this commit is part of a pull request that is created, the linkage is made visible as part of the pull request.</p></li>
  <li><p><a href="https://docs.microsoft.com/en-us/azure/devops/repos/git/pull-requests?view=azure-devops#add-detail-to-your-pull-request" rel="nofollow noreferrer">Within the pull request</a> during creation, or afterward when edited by the creator, you can add work items directly to the pull request by searching either by ID or by keywords.</p></li>
  <li><p><a href="https://docs.microsoft.com/en-us/azure/devops/boards/queries/link-work-items-support-traceability?view=azure-devops&amp;tabs=new-web-form#work-items-linked-to-git-code-development" rel="nofollow noreferrer">Several other methods</a> can be discovered through editing a work item or right in Visual Studio.</p></li>
  </ol>
  
Answers: CC BY-SA 4.0
Answers: 2019-04-10T00:27:33.007Z
Answers: 2019-04-10T00:27:33.007Z
Answers: Sumo
Answers: <p>Work Items created in Projects, not in Repos.</p>
  
  <p>And yes, you can link to PR also work items from another projects.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-04-03T15:03:55.360Z
Answers: How would you go about doing that?
Answers: Shahar Prish
Answers: CC BY-SA 4.0
Answers: 2019-04-03T16:23:45.790Z
Answers: Like link any work item in PR, just give the work item ID in the PR page.
Answers: Shayki Abramczyk
Answers: CC BY-SA 4.0
Answers: 2019-04-03T07:51:25.120Z
Answers: 2019-04-03T07:51:25.120Z
Answers: Shayki Abramczyk
Body: <p>Say I have 2 repos...</p>
  
  <p>And I have a work item (or bug, or whatever) in one repo, and my code in another repo (yes, I know it's silly, that's how my group rolls for historical reasons).</p>
  
  <p>Is there a way to assign a bug from one to the other? So that when I create a PR in Repo1, I can link to a bug in Repo2?</p>
  
Comments: CC BY-SA 4.0
Comments: 2019-04-03T02:27:53.023Z
Comments: Not an Azure user, but in general when the tools setup has limits seek a compromise. I'd open a new item in the correct repo, add a reference to it in the old item (for tracking purposes, maybe copy/link some info over if it makes sense), close the old item (since you say you can't really work on it), then work on the new item instead.
Comments: Dan Cornilescu
Tags: <azure-devops>
Title: Assign bug from different repo when creating a pull request
UserDisplayName: Shahar Prish
ThreadText: # Assign bug from different repo when creating a pull request
  
  (Asked by: username_0 on 2019-04-02)
  
  Say I have 2 repos...
  
  And I have a work item (or bug, or whatever) in one repo, and my code in another repo (yes, I know it's silly, that's how my group rolls for historical reasons).
  
  Is there a way to assign a bug from one to the other? So that when I create a PR in Repo1, I can link to a bug in Repo2?
  
  **Tags:** azure-devops
  
  > **Comments:**
  > **username_1**: Not an Azure user, but in general when the tools setup has limits seek a compromise. I'd open a new item in the correct repo, add a reference to it in the old item (for tracking purposes, maybe copy/link some info over if it makes sense), close the old item (since you say you can't really work on it), then work on the new item instead.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-04-10. Score: 1
  
  There are actually many ways to link work items to other objects in Azure DevOps. [Microsoft's documentation](https://docs.microsoft.com/en-us/azure/devops/boards/queries/link-work-items-support-traceability?view=azure-devops&tabs=new-web-form#work-items-linked-to-git-code-development) is pretty extensive on this topic. However, for the particular task at hand, linking code commits (I'll assume Git is in use for this example), can be done in several different ways.
  
  1. In your commit message - By including the work item ID in the commit message prefixed with the hash mark `#` (i.e. `#12345`), when the commit is pushed to the server, the work item and commit are linked automatically. Then, when this commit is part of a pull request that is created, the linkage is made visible as part of the pull request.
  2. [Within the pull request](https://docs.microsoft.com/en-us/azure/devops/repos/git/pull-requests?view=azure-devops#add-detail-to-your-pull-request) during creation, or afterward when edited by the creator, you can add work items directly to the pull request by searching either by ID or by keywords.
  3. [Several other methods](https://docs.microsoft.com/en-us/azure/devops/boards/queries/link-work-items-support-traceability?view=azure-devops&tabs=new-web-form#work-items-linked-to-git-code-development) can be discovered through editing a work item or right in Visual Studio.
  
  
  ---
  
  ### Answer by username_3 on 2019-04-03. Score: 0
  
  Work Items created in Projects, not in Repos.
  
  And yes, you can link to PR also work items from another projects.
  
  > **Comments:**
  > **username_0**: How would you go about doing that?  
  > **username_3**: Like link any work item in PR, just give the work item ID in the PR page.  
  
  ---
  
  