共用方式為


Templates - List

取得範本

GET https://dev.azure.com/{organization}/{project}/{team}/_apis/wit/templates?api-version=7.1-preview.1
GET https://dev.azure.com/{organization}/{project}/{team}/_apis/wit/templates?workitemtypename={workitemtypename}&api-version=7.1-preview.1

URI 參數

名稱 位於 必要 類型 Description
organization
path True

string

Azure DevOps 組織的名稱。

project
path True

string

專案識別碼或專案名稱

team
path True

string

小組識別碼或小組名稱

api-version
query True

string

要使用的 API 版本。 這應該設定為 '7.1-preview.1' 以使用此版本的 API。

workitemtypename
query

string

選擇性,當指定 傳回指定工作專案類型的範本時。

回應

名稱 類型 Description
200 OK

WorkItemTemplateReference[]

成功的作業

安全性

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

名稱 Description
vso.work 授與讀取工作專案、查詢、面板、區域和反復專案路徑,以及其他工作專案追蹤相關中繼資料的能力。 也授與執行查詢、搜尋工作專案,以及透過服務勾點接收工作專案事件通知的能力。

範例

Gets templates

Sample Request

GET https://dev.azure.com/{organization}/{project}/{team}/_apis/wit/templates?api-version=7.1-preview.1

Sample Response

{
  "count": 9,
  "value": [
    {
      "id": "5dbed2c3-1534-4894-aff4-0234fa3ae56d",
      "name": "Test Template",
      "description": "",
      "workItemTypeName": "Feature",
      "_links": {
        "workItemType": {
          "href": "https://dev.azure.com/fabrikamm0652/00487116-45c8-4be1-a19b-ae0de259e618/_apis/wit/workItemTypes/Feature"
        },
        "self": {
          "href": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/5dbed2c3-1534-4894-aff4-0234fa3ae56d"
        }
      },
      "url": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/5dbed2c3-1534-4894-aff4-0234fa3ae56d"
    },
    {
      "id": "2564ee23-9824-4cde-a42d-3036adaf50e7",
      "name": "Test Template",
      "description": "",
      "workItemTypeName": "Feature",
      "_links": {
        "workItemType": {
          "href": "https://dev.azure.com/fabrikamm0652/00487116-45c8-4be1-a19b-ae0de259e618/_apis/wit/workItemTypes/Feature"
        },
        "self": {
          "href": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/2564ee23-9824-4cde-a42d-3036adaf50e7"
        }
      },
      "url": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/2564ee23-9824-4cde-a42d-3036adaf50e7"
    },
    {
      "id": "05132b3a-41d6-430f-8738-42b20b34a601",
      "name": "Test Template",
      "description": "Template to be created",
      "workItemTypeName": "Feature",
      "_links": {
        "workItemType": {
          "href": "https://dev.azure.com/fabrikamm0652/00487116-45c8-4be1-a19b-ae0de259e618/_apis/wit/workItemTypes/Feature"
        },
        "self": {
          "href": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/05132b3a-41d6-430f-8738-42b20b34a601"
        }
      },
      "url": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/05132b3a-41d6-430f-8738-42b20b34a601"
    },
    {
      "id": "40ca92a6-0e32-4b44-8e57-664127faa0be",
      "name": "Test Template",
      "description": "",
      "workItemTypeName": "Feature",
      "_links": {
        "workItemType": {
          "href": "https://dev.azure.com/fabrikamm0652/00487116-45c8-4be1-a19b-ae0de259e618/_apis/wit/workItemTypes/Feature"
        },
        "self": {
          "href": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/40ca92a6-0e32-4b44-8e57-664127faa0be"
        }
      },
      "url": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/40ca92a6-0e32-4b44-8e57-664127faa0be"
    },
    {
      "id": "9363ac38-9e16-44b2-8a76-76480f366e2f",
      "name": "Test Template",
      "description": "Template to be created",
      "workItemTypeName": "Feature",
      "_links": {
        "workItemType": {
          "href": "https://dev.azure.com/fabrikamm0652/00487116-45c8-4be1-a19b-ae0de259e618/_apis/wit/workItemTypes/Feature"
        },
        "self": {
          "href": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/9363ac38-9e16-44b2-8a76-76480f366e2f"
        }
      },
      "url": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/9363ac38-9e16-44b2-8a76-76480f366e2f"
    },
    {
      "id": "2e703f7c-b028-4bf3-883d-7e641758a1f2",
      "name": "Test Template",
      "description": "",
      "workItemTypeName": "Feature",
      "_links": {
        "workItemType": {
          "href": "https://dev.azure.com/fabrikamm0652/00487116-45c8-4be1-a19b-ae0de259e618/_apis/wit/workItemTypes/Feature"
        },
        "self": {
          "href": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/2e703f7c-b028-4bf3-883d-7e641758a1f2"
        }
      },
      "url": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/2e703f7c-b028-4bf3-883d-7e641758a1f2"
    },
    {
      "id": "72608fee-226d-4c34-821a-82edeef99dbf",
      "name": "Test Template",
      "description": "",
      "workItemTypeName": "Feature",
      "_links": {
        "workItemType": {
          "href": "https://dev.azure.com/fabrikamm0652/00487116-45c8-4be1-a19b-ae0de259e618/_apis/wit/workItemTypes/Feature"
        },
        "self": {
          "href": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/72608fee-226d-4c34-821a-82edeef99dbf"
        }
      },
      "url": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/72608fee-226d-4c34-821a-82edeef99dbf"
    },
    {
      "id": "88c9ab05-74cc-45ff-a39d-a4400ff70796",
      "name": "Test Template",
      "description": "",
      "workItemTypeName": "Feature",
      "_links": {
        "workItemType": {
          "href": "https://dev.azure.com/fabrikamm0652/00487116-45c8-4be1-a19b-ae0de259e618/_apis/wit/workItemTypes/Feature"
        },
        "self": {
          "href": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/88c9ab05-74cc-45ff-a39d-a4400ff70796"
        }
      },
      "url": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/88c9ab05-74cc-45ff-a39d-a4400ff70796"
    },
    {
      "id": "d1e32bd5-98f6-4ad6-b035-e131aa1b4cdb",
      "name": "Test Template",
      "description": "",
      "workItemTypeName": "Feature",
      "_links": {
        "workItemType": {
          "href": "https://dev.azure.com/fabrikamm0652/00487116-45c8-4be1-a19b-ae0de259e618/_apis/wit/workItemTypes/Feature"
        },
        "self": {
          "href": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/d1e32bd5-98f6-4ad6-b035-e131aa1b4cdb"
        }
      },
      "url": "https://dev.azure.com/fabrikamm0652/Test%20Project/3481fbc6-b38e-4a68-ae98-53720872d5db/_apis/wit/templates/d1e32bd5-98f6-4ad6-b035-e131aa1b4cdb"
    }
  ]
}

定義

名稱 Description
ReferenceLinks

表示 REST 參考連結集合的類別。

WorkItemTemplateReference

描述工作專案範本的淺層參考。

表示 REST 參考連結集合的類別。

名稱 類型 Description
links

object

連結的唯讀檢視。 因為參考連結是唯讀的,所以我們只想要將它們公開為唯讀。

WorkItemTemplateReference

描述工作專案範本的淺層參考。

名稱 類型 Description
_links

ReferenceLinks

連結相關 REST 資源的參考。

description

string

工作專案範本的描述。

id

string

工作專案範本的識別碼。

name

string

工作專案範本的名稱。

url

string

workItemTypeName

string

工作項目類型的名稱。