Search code examples
azure-devopspowerbi

Azure Devops Server Parent field has incorrect date when dragging and dropping stories in between features


Imagine the following scenario.

I am working in Azure DevOps Server (TFS)

I have a story that on January 1st 2024, had a parent work item of 00001.

Today, I dragged drop that story (using the backlog view) from feature 001 to 002.

Then when I look at the history of the story, the history is modified to say that the 'Parent' field of the story was modified to 002 on the date Jan 1 2024. All the while, it also says that the Parent Link was modified on Jul 22 2024.

This behavior is only shown when I drag and drop stories between features. If I right click on the story, and select "change parent", then there is no reference to modifying the Parent field. Only a reference to modifying the Parent Link field.

Is this behavior anticipated? This sounds like a bug. This is affecting some charts that we have in PowerBI, because it leverages WorkItemSnapshots. WorkItemSnapshots leverage the Parent field (not the Parent Link field). As far as I can tell, there is no snapshot equivalent for links.

I have tried looking for Parent Link Snapshots, but I am stuck using the Parent Field.


Solution

  • I can reproduce the same issue no matter I drag and drop stories between features, or I right click on the story and select "change parent".

    It seems that there is a bug when change the parent of the work item. When the Parent Link field is changed, the 'Parent' field will not create a separate history but added the change to the last field change history. I tried with Azure DevOps Server 2020, Azure DevOps Server 2022 and even Azure DevOps Service, and the same issue happens.

    Reproduce steps:

    1. Create three work items named Feature 1, Feature 2 and User Story.

    2. Add Feature 1 to the User Story as the parent and save the work item.

    3. Check the History of the User Story. (In fact, you can see the problem at this step. I created the user story at 11:45 AM, and added the parent at 11:47 AM. But it shows that the parent field id 6 already existed when the user story was created at 11:45 AM.) History

    4. Go to backlog page and drag and drop stories between features, or right click on the story and select "change parent". Then check the history again. This time it shows that the parent field id is changed to 7 at 11:45 AM. In fact, I changed the parent at 11:52 AM. History2

    I have created a bug ticket here to report the issue. You can follow it to check the update.

    If this affects your use of WorkItemSnapshots, you might consider Query WorkItemLinks instead. It can return the links between work items, and includes only the latest revision of links, no history.