Azure DevOps Workitem types API не возвращает только типы, настроенные в процессе в Devops - PullRequest
0 голосов
/ 05 августа 2020

Azure DevOps не перенастраивает единственные типы рабочих элементов, которые я настроил для своего процесса. Он также дает с некоторыми дополнительными типами рабочих элементов

API:

GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitemtypes?api-version=5.1

Do c: https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20item%20types/list?view=azure-devops-rest-5.1

Например,

Возвращено:

Issue
Epic
Task
Test Case
Test Plan
Test Suite
Shared Steps
Shared Parameter
Code Review Request
Code Review Response
Feedback Request
Feedback Response

Ожидается: (только эти типы)

Issue
Epic
Task

Если есть какой-либо другой API, который возвращает только типы, показанные в azure DevOps при создании нового рабочего элемента на досках, пожалуйста, дайте мне знать

Заранее спасибо

Ответы [ 2 ]

1 голос
/ 10 августа 2020

API:

https://dev.azure.com/{org_name}/{proj_name}/_apis/wit/workItemTypeCategories?api-version=5.1

Ответ:

JSON Массив с типами рабочих элементов,

{
"count": 15,
"value": [
    {
        "name": "Bug Category",
        "referenceName": "Microsoft.BugCategory",
        "defaultWorkItemType": {
            "name": "Bug",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.Bug"
        },
        "workItemTypes": [
            {
                "name": "Bug",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.Bug"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.BugCategory"
    },
    {
        "name": "Epic Category",
        "referenceName": "Microsoft.EpicCategory",
        "defaultWorkItemType": {
            "name": "Epic",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.Epic"
        },
        "workItemTypes": [
            {
                "name": "Epic",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.Epic"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.EpicCategory"
    },
    {
        "name": "Feature Category",
        "referenceName": "Microsoft.FeatureCategory",
        "defaultWorkItemType": {
            "name": "Feature",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.Feature"
        },
        "workItemTypes": [
            {
                "name": "Feature",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.Feature"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.FeatureCategory"
    },
    {
        "name": "Requirement Category",
        "referenceName": "Microsoft.RequirementCategory",
        "defaultWorkItemType": {
            "name": "User Story",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.UserStory"
        },
        "workItemTypes": [
            {
                "name": "User Story",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.UserStory"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.RequirementCategory"
    },
    {
        "name": "Test Case Category",
        "referenceName": "Microsoft.TestCaseCategory",
        "defaultWorkItemType": {
            "name": "Test Case",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.TestCase"
        },
        "workItemTypes": [
            {
                "name": "Test Case",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.TestCase"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.TestCaseCategory"
    },
    {
        "name": "Shared Step Category",
        "referenceName": "Microsoft.SharedStepCategory",
        "defaultWorkItemType": {
            "name": "Shared Steps",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.SharedStep"
        },
        "workItemTypes": [
            {
                "name": "Shared Steps",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.SharedStep"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.SharedStepCategory"
    },
    {
        "name": "Shared Parameter Category",
        "referenceName": "Microsoft.SharedParameterCategory",
        "defaultWorkItemType": {
            "name": "Shared Parameter",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.SharedParameter"
        },
        "workItemTypes": [
            {
                "name": "Shared Parameter",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.SharedParameter"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.SharedParameterCategory"
    },
    {
        "name": "Code Review Request Category",
        "referenceName": "Microsoft.CodeReviewRequestCategory",
        "defaultWorkItemType": {
            "name": "Code Review Request",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.CodeReviewRequest"
        },
        "workItemTypes": [
            {
                "name": "Code Review Request",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.CodeReviewRequest"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.CodeReviewRequestCategory"
    },
    {
        "name": "Code Review Response Category",
        "referenceName": "Microsoft.CodeReviewResponseCategory",
        "defaultWorkItemType": {
            "name": "Code Review Response",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.CodeReviewResponse"
        },
        "workItemTypes": [
            {
                "name": "Code Review Response",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.CodeReviewResponse"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.CodeReviewResponseCategory"
    },
    {
        "name": "Feedback Request Category",
        "referenceName": "Microsoft.FeedbackRequestCategory",
        "defaultWorkItemType": {
            "name": "Feedback Request",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.FeedbackRequest"
        },
        "workItemTypes": [
            {
                "name": "Feedback Request",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.FeedbackRequest"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.FeedbackRequestCategory"
    },
    {
        "name": "Feedback Response Category",
        "referenceName": "Microsoft.FeedbackResponseCategory",
        "defaultWorkItemType": {
            "name": "Feedback Response",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.FeedbackResponse"
        },
        "workItemTypes": [
            {
                "name": "Feedback Response",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.FeedbackResponse"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.FeedbackResponseCategory"
    },
    {
        "name": "Test Plan Category",
        "referenceName": "Microsoft.TestPlanCategory",
        "defaultWorkItemType": {
            "name": "Test Plan",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.TestPlan"
        },
        "workItemTypes": [
            {
                "name": "Test Plan",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.TestPlan"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.TestPlanCategory"
    },
    {
        "name": "Test Suite Category",
        "referenceName": "Microsoft.TestSuiteCategory",
        "defaultWorkItemType": {
            "name": "Test Suite",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.TestSuite"
        },
        "workItemTypes": [
            {
                "name": "Test Suite",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.TestSuite"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.TestSuiteCategory"
    },
    {
        "name": "Task Category",
        "referenceName": "Microsoft.TaskCategory",
        "defaultWorkItemType": {
            "name": "Task",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.Task"
        },
        "workItemTypes": [
            {
                "name": "Task",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.Task"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.TaskCategory"
    },
    {
        "name": "Hidden Types Category",
        "referenceName": "Microsoft.HiddenCategory",
        "defaultWorkItemType": {
            "name": "Code Review Request",
            "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.CodeReviewRequest"
        },
        "workItemTypes": [
            {
                "name": "Code Review Request",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.CodeReviewRequest"
            },
            {
                "name": "Code Review Response",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.CodeReviewResponse"
            },
            {
                "name": "Feedback Request",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.FeedbackRequest"
            },
            {
                "name": "Feedback Response",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.FeedbackResponse"
            },
            {
                "name": "Shared Steps",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.SharedStep"
            },
            {
                "name": "Shared Parameter",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.SharedParameter"
            },
            {
                "name": "Test Plan",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.TestPlan"
            },
            {
                "name": "Test Suite",
                "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypes/Microsoft.VSTS.WorkItemTypes.TestSuite"
            }
        ],
        "url": "https://dev.azure.com/{org_name}/def0f1fb-8a14-43d2-a829-9307e3c549cd/_apis/wit/workItemTypeCategories/Microsoft.HiddenCategory"
    }
]

}

Последний индекс массива value содержит типы рабочих элементов, которые не будут видны в AZD при создании нового рабочего элемента.

Поэтому в моем В этом случае мне пришлось вручную перебрать типы рабочих элементов, присутствующие в последнем индексе, и удалить их.

0 голосов
/ 06 августа 2020

Вы можете использовать get Backlogconfiguration rest api, чтобы получить типы рабочих элементов на каждом уровне отставания.

GET https://dev.azure.com/{organization}/{project}/_apis/work/backlogconfiguration?api-version=5.1

Он будет возвращать только типы рабочих элементов ( ie .Issue, Epi c, Task), которые отображаются на azure досках DevOps.

Обновление:

Если вы настроили типы рабочих элементов. Возможно, вам придется добавить свои настраиваемые типы рабочих элементов в очередь. Или создайте new top level Portfolio backlogs для хранения настраиваемого типа рабочего элемента. См. Ниже:

1, Go в настройках организации -> Процесс -> Выберите унаследованный процесс -> вкладка Уровни невыполненных работ

enter image description here

2, Add custom work item type to a backlog, or create a new top level Portfolio backlog:

Click the 3dots of the backlog you want to add the custom work item type-->Check the cutom work item type you want to add. See below:

введите описание изображения здесь

...