title: Azure DevOps WorkItem Tracking not working when code generated
body: <p>I have a problem with azure devops workitem tracking.
  So we want to use WorkItem tracking for work items, that do not need changes in our source code.</p>
  <p>Currently we are tracking Builds and Releases with C# and the <code>Microsoft.TeamFoundation.WorkItemTracking</code> NuGet packages.</p>
  <p>The visualization for the build tracking is ok, but the deployments won´t show in the details pane of a ticket.</p>
  <p>OK</p>
  <p><img src="https://i.stack.imgur.com/tAlfN.png" alt="Ticket related with code" /></p>
  <p>Not OK</p>
  <p><img src="https://i.stack.imgur.com/dhM7c.png" alt="Ticket related with CI/CD" /></p>
  <p>The relations both in azure devops and as shown in the debugger seem to be the same:</p>
  <p><img src="https://i.stack.imgur.com/AIpMN.png" alt="Ticket Links from ticket related in code" /></p>
  <p>This is our patch operation:</p>
  <pre><code>new JsonPatchOperation()
                              {
                                  Operation = Operation.Add,
                                  Path = &quot;/relations/-&quot;,
                                  Value = new
                                  {
                                      rel = &quot;ArtifactLink&quot;,
                                      url = &quot;vstfs:///ReleaseManagement/ReleaseEnvironment/&quot; + temp.Href.Split('/')[4] + &quot;:&quot;+ release.Id + &quot;:&quot; + environment.Id, 
                                      attributes = new
                                      {
                                          authorizedDate = DateTime.Now,
                                          //comment = &quot;This build was automatically linked to this work item based on the Tool&quot;,
                                          resourceCreatedDate = DateTime.Now,
                                          resourceModifiedDate = DateTime.Now,
                                          name = &quot;Integrated in release environment&quot;,
                                          revisedDate = new DateTime(9999, 1, 1, 0, 0, 0, 0)
                                      }
                                  }
                              }
  </code></pre>
  <p>What should I do, to have the related Release displayed in the details pane of the ticket?
  I compared every attribute while debugging with a sample ticket I created with CI/CD, every link and relation is OK. Builds are shown, releases not.</p>