共用方式為


Pull Request Statuses - Get

依標識碼取得特定的提取要求狀態。 所有反覆專案的提取要求內的狀態標識碼是唯一的。

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}?api-version=7.1

URI 參數

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

string

Azure DevOps 組織的名稱。

pullRequestId
path True

integer (int32)

提取要求的標識碼。

repositoryId
path True

string

提取要求目標分支的存放庫標識碼。

statusId
path True

integer (int32)

提取要求狀態的識別碼。

project
path

string

項目識別碼或項目名稱

api-version
query True

string

要使用的 API 版本。 這應該設定為 『7.1』 以使用此版本的 API。

回應

名稱 類型 Description
200 OK

GitPullRequestStatus

成功作業

安全性

oauth2

類型: oauth2
Flow: accessCode
授權 URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
權杖 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

範圍

名稱 Description
vso.code 授與讀取有關認可、變更集、分支和其他版本控制成品之原始程式碼和元數據的能力。 也授與搜尋程式代碼的能力,並透過服務攔截取得版本控制事件的通知。
vso.code_status 授與讀取和寫入認可和提取要求狀態的能力。

範例

範例要求

GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}?api-version=7.1

範例回覆

{
  "id": 1,
  "state": "succeeded",
  "description": "Sample status succeeded",
  "context": {
    "name": "sample-status-1",
    "genre": "vsts-samples"
  },
  "creationDate": "2017-09-19T14:50:27.4949745Z",
  "updatedDate": "2017-09-19T14:50:27.4949745Z",
  "createdBy": {
    "id": "6f168adb-59d4-4fc0-be3b-fb21b939b2a6",
    "displayName": "Normal Paulk",
    "uniqueName": "fabrikamfiber16@hotmail.com",
    "url": "https://dev.azure.com/fabrikam/_apis/Identities/6f168adb-59d4-4fc0-be3b-fb21b939b2a6",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=6f168adb-59d4-4fc0-be3b-fb21b939b2a6"
  },
  "targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1",
  "_links": {
    "self": {
      "href": "https://dev.azure.com/fabrikam/_apis/git/repositories/b92c8408-a0c9-4292-88af-bc005a1b8272/pullRequests/5/statuses/1"
    },
    "repository": {
      "href": "https://dev.azure.com/fabrikam/_apis/git/repositories/b92c8408-a0c9-4292-88af-bc005a1b8272"
    }
  }
}

定義

名稱 Description
GitPullRequestStatus

這個類別包含服務/擴充功能張貼提取要求狀態的元數據。 狀態可以與提取要求或反覆項目相關聯。

GitStatusContext

可唯一識別狀態的狀態內容。

GitStatusState

狀態的狀態。

IdentityRef
PropertiesCollection

類別會將屬性包表示為索引鍵/值組的集合。 接受 DBNull 以外的所有基本類型值(任何具有 TypeCode != TypeCode.Object的類型)。 Byte[]、Int32、Double、DateType 和 String 類型的值會保留其類型,其他基本類型會重新調整為 String。 Byte[] 預期為base64編碼字串。

ReferenceLinks

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

GitPullRequestStatus

這個類別包含服務/擴充功能張貼提取要求狀態的元數據。 狀態可以與提取要求或反覆項目相關聯。

名稱 類型 Description
_links

ReferenceLinks

參考連結。

context

GitStatusContext

狀態的內容。

createdBy

IdentityRef

建立狀態的身分識別。

creationDate

string (date-time)

狀態的建立日期和時間。

description

string

狀態描述。 通常描述狀態的目前狀態。

id

integer (int32)

狀態標識碼。

iterationId

integer (int32)

要與狀態產生關聯之反覆專案的標識碼。 最小值為 1。

properties

PropertiesCollection

狀態的自定義屬性。

state

GitStatusState

狀態的狀態。

targetUrl

string

具有狀態詳細數據的 URL。

updatedDate

string (date-time)

狀態的上次更新日期和時間。

GitStatusContext

可唯一識別狀態的狀態內容。

名稱 類型 Description
genre

string

狀態的內容類型。 通常產生狀態的服務/工具名稱可以是空的。

name

string

狀態的名稱識別碼不可為 Null 或空白。

GitStatusState

狀態的狀態。

Description
error

發生錯誤的狀態。

failed

狀態失敗。

notApplicable

狀態不適用於目標物件。

notSet

未設定狀態。 默認狀態。

pending

狀態擱置中。

succeeded

狀態成功。

IdentityRef

名稱 類型 Description
_links

ReferenceLinks

此欄位包含圖表主旨的相關零或更多有趣連結。 您可以叫用這些連結,以取得此圖表主題的其他關聯性或更詳細的資訊。

descriptor

string

描述元是在系統執行時參考圖表主旨的主要方式。 此欄位會唯一識別帳戶和組織之間的相同圖表主題。

directoryAlias

string

已淘汰 - 查詢 IdentityRef “_links” 字典中參考的 Graph 使用者,即可擷取

displayName

string

這是圖形主體的非唯一顯示名稱。 若要變更此欄位,您必須在來源提供者中變更其值。

id

string

imageUrl

string

已淘汰 - 可在 IdentityRef “_links” 字典的 “avatar” 專案中取得

inactive

boolean

已淘汰 - 可藉由查詢 GraphUser “_links” 字典的 “membershipState” 專案中參考的 Graph 成員資格狀態來擷取

isAadIdentity

boolean

已淘汰 - 可以從描述元的主體類型推斷 (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)

isContainer

boolean

已淘汰 - 可以從描述元的主體類型推斷 (Descriptor.IsGroupType)

isDeletedInOrigin

boolean

profileUrl

string

已淘汰 - 未在 ToIdentityRef 的大部分預先存在實作中使用

uniqueName

string

已淘汰 - 請改用 Domain+PrincipalName

url

string

此 URL 是此圖表主體來源資源的完整路由。

PropertiesCollection

類別會將屬性包表示為索引鍵/值組的集合。 接受 DBNull 以外的所有基本類型值(任何具有 TypeCode != TypeCode.Object的類型)。 Byte[]、Int32、Double、DateType 和 String 類型的值會保留其類型,其他基本類型會重新調整為 String。 Byte[] 預期為base64編碼字串。

名稱 類型 Description
count

integer (int32)

集合中的屬性計數。

item

object

keys

string[]

集合中的索引鍵集合。

values

string[]

集合中的值集合。

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

名稱 類型 Description
links

object

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