代码之家  ›  专栏  ›  技术社区  ›  Kai Walter

从Azure DevOps REST API获取策略配置时,无法识别必需的和可选的审阅者

  •  0
  • Kai Walter  · 技术社区  · 5 年前

    我在此API上查询策略配置: https://docs.microsoft.com/en-us/rest/api/azure/devops/policy/configurations/get?view=azure-devops-rest-5.0

    策略确实设置了必需和可选的审阅者组,但我无法从REST API返回的响应中判断:

    {
        "createdBy": {...},
        "createdDate": "2018-11-30T04:35:02.2816989Z",
        "isEnabled": true,
        "isBlocking": true,
        "isDeleted": false,
        "settings": {
            "requiredReviewerIds": "7ca7ce21-a99d-4873-aea7-ba4de2c6fc54",
            "scope": ""
        },
        "_links": {
            "self": "@{href=https://dev.azure.com/myAccount/11111111-2222-3333-4444-555555555555/_apis/policy/configurations/1953}",
            "policyType": "@{href=https://dev.azure.com/myAccount/11111111-2222-3333-4444-555555555555/_apis/policy/types/fd2167ab-b0be-447a-8ec8-39368250530e}"
        },
        "revision": 1,
        "id": 1953,
        "url": "https://dev.azure.com/myAccount/11111111-2222-3333-4444-555555555555/_apis/policy/configurations/1953",
        "type": {
            "id": "fd2167ab-b0be-447a-8ec8-39368250530e",
            "url": "https://dev.azure.com/myAccount/11111111-2222-3333-4444-555555555555/_apis/policy/types/fd2167ab-b0be-447a-8ec8-39368250530e",
            "displayName": "Required reviewers"
        }
    },
    {
        "createdBy": {...},
        "createdDate": "2019-01-18T09:38:32.9506909Z",
        "isEnabled": true,
        "isBlocking": false,
        "isDeleted": false,
        "settings": {
            "requiredReviewerIds": "0bd7df6e-9f54-408a-bccf-25ace8912acf",
            "scope": ""
        },
        "_links": {
            "self": "@{href=https://dev.azure.com/myAccount/11111111-2222-3333-4444-555555555555/_apis/policy/configurations/2101}",
            "policyType": "@{href=https://dev.azure.com/myAccount/11111111-2222-3333-4444-555555555555/_apis/policy/types/fd2167ab-b0be-447a-8ec8-39368250530e}"
        },
        "revision": 1,
        "id": 2101,
        "url": "https://dev.azure.com/myAccount/11111111-2222-3333-4444-555555555555/_apis/policy/configurations/2101",
        "type": {
            "id": "fd2167ab-b0be-447a-8ec8-39368250530e",
            "url": "https://dev.azure.com/myAccount/11111111-2222-3333-4444-555555555555/_apis/policy/types/fd2167ab-b0be-447a-8ec8-39368250530e",
            "displayName": "Required reviewers"
        }
    }
    

    我错过了什么?

    1 回复  |  直到 5 年前
        1
  •  1
  •   Daniel Mann    5 年前

    isBlocking 决定策略是否可选的标志。