Search code examples
tfsazure-devopstfs-workitem

TFS WorkItemRelation Attributes Object?


In reference to this document: https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/get%20work%20item%20template?view=azure-devops-rest-4.1#workitemrelation

At the bottom of the page, the description of the WorkItemRelation is:

WorkItemRelation

+------------------------------------------------------+
+    Name    +  Type  +           Description          +
+------------+--------+--------------------------------+
+------------+--------+--------------------------------+
+ attributes + object + Collection of link attributes. +
+------------+--------+--------------------------------+
+     rel    + string + Relation type.                 +
+------------+--------+--------------------------------+
+     url    + string + Link url                       + 
+------------+--------+--------------------------------+

What is the attributes object? I can not find the definition of it. Has anyone used the TFS api enough to be familiar?


Solution

  • The attribute is the object type which helps us to identify the detailed properties of the workitem relationship types,

    You can easily get the definition of the attributes from Work Item Relation Types API

    Example:

    {
      "attributes": {
        "usage": "workItemLink",
        "editable": false,
        "enabled": true,
        "acyclic": true,
        "directional": true,
        "singleTarget": false,
        "topology": "tree",
        "isForward": true,
        "oppositeEndReferenceName": "System.LinkTypes.Duplicate-Reverse"
      },
      "referenceName": "System.LinkTypes.Duplicate-Forward",
      "name": "Duplicate",
      "url": "https://dev.azure.com/fabrikam/_apis/wit/workItemRelationTypes/System.LinkTypes.Duplicate-Forward"
    }
    

    The Attributes consist of the following JSON elements,

    • usage
    • editable
    • enabled
    • acyclic
    • directional
    • singleTarget
    • topology
    • isForward
    • oppositeEndreferenceName