Search code examples
azure-devopsazure-devops-rest-api

Unable to run Rest API Command


https://dev.azure.com/{organization}/_apis/work/processdefinitions/{processId}/workItemTypes/{witRefName}/layout?api-version=4.1-preview.1

In the above command I use the full URL of workItemTypes(witRefName) but still not getting any output. I have tried using the work item names like Epic and that does not work either. Does anyone know what goes in there or what I am missing? The command I user before this is

https://dev.azure.com/{organization}/_apis/work/processdefinitions/{processId}/workitemtypes?api-version=4.1-preview.1

Solution

  • If you follow this API (get all work item types) :

    https://dev.azure.com/{organization}/_apis/work/processdefinitions/{processId}/workitemtypes?api-version=4.1-preview.1
    
    
    

    Output :

    "id": "Microsoft.VSTS.WorkItemTypes.Bug",
    "name": "Bug",
    "description": "Describes a divergence between required and actual behavior, and tracks the work done to correct the defect and verify the correction.",
    "url": "https://dev.azure.com/domain/_apis/work/processDefinitions/processId/workItemTypes/Microsoft.VSTS.WorkItemTypes.Bug",
    "inherits": null,
    "class": "system",
    "color": "CC293D",
    "icon": "icon_insect",
    "isDisabled": false
    

    The witRefName keyword is the id from the last response, Microsoft.VSTS.WorkItemTypes.Bug

    And here's the new url to get layout :

    https://dev.azure.com/{organization}/_apis/work/processes/{processId}/workItemTypes/Microsoft.VSTS.WorkItemTypes.Bug/layout?api-version=7.0