'How WorkItem and Changeset needs to be related to show WorkItem in CodeLens

in our company we use some ticket system instead of workitems. I saw that Codelens in Visual Studio can show workitem, codereview or bugs. I tried to create changeset with workitem and it works fine. We can stay in current ticket system but I think it could be fine information to see how many tickets or bugs are in code by Codelens. In each changeset I have ticked id by checkin notes. My idea is that I can get changeset create workitem specific type by ticket and associate changeset with workitem. I tried it by Azure DevOps REST API. WorkItem is created and it is associated with changeset. I can see workitem in chageset detail. But there is no information about workitem in Codelens.
I tried to reindex Codelens information by TFSConfig tool. Nothing changed. When I get information about workitem or changeset by REST API I can see same relations between changeset and workitem as at first changeset where I added workitem directly to changeset. I tried to find relation between workitem and changeset in Azure DevOps database. I can see them in WorkItemFiles table. There are two difference only. First is that there is not comment when I add changeset to workitem. When workitem is associated with changeset in Visual Studio when check in then there is changeset comment. Second difference is that relation has AddedDate much later than chageset was created. Maybe there could be third difference that WorkItem is created later than changeset.

There could be something what I missed. Thanks for any idea what can get chance to show workitem in codelens.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source