共用方式為


Pull Request Statuses - Get

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

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}?api-version=7.1-preview.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-preview.1' 以使用此版本的 API。

回應

名稱 類型 Description
200 OK

GitPullRequestStatus

成功作業

安全性

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.code 授與讀取有關認可、變更集、分支和其他版本控制成品之原始程式碼和中繼資料的能力。 也授與搜尋程式碼的能力,並透過服務勾點取得版本控制事件的通知。
vso.code_status 授與讀取和寫入認可和提取要求狀態的能力。

範例

Sample Request

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

Sample Response

{
  "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

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

ReferenceLinks

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

GitPullRequestStatus

這個類別包含服務/延伸模組張貼提取要求狀態的中繼資料。 狀態可以與提取要求或反復專案相關聯。

名稱 類型 Description
_links

ReferenceLinks

參考連結。

context

GitStatusContext

狀態的內容。

createdBy

IdentityRef

建立狀態的身分識別。

creationDate

string

建立狀態的日期和時間。

description

string

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

id

integer

狀態識別碼。

iterationId

integer

要與狀態建立關聯之反復專案的識別碼。 最小值為 1。

properties

PropertiesCollection

狀態的自訂屬性。

state

GitStatusState

狀態的狀態。

targetUrl

string

具有狀態詳細資料的 URL。

updatedDate

string

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

GitStatusContext

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

名稱 類型 Description
genre

string

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

name

string

狀態的名稱識別碼不能是 Null 或空白。

GitStatusState

狀態的狀態。

名稱 類型 Description
error

string

發生錯誤的狀態。

failed

string

狀態失敗。

notApplicable

string

狀態不適用於目標物件。

notSet

string

未設定狀態。 預設狀態。

pending

string

狀態暫止。

succeeded

string

狀態成功。

IdentityRef

名稱 類型 Description
_links

ReferenceLinks

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

descriptor

string

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

directoryAlias

string

已被取代 - 您可以藉由查詢 IdentityRef 「_links」 字典的 「self」 專案中參考的 Graph 使用者來擷取

displayName

string

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

id

string

imageUrl

string

已淘汰 - 可在 IdentityRef 「_links」 字典的 「avatar」 專案中使用

inactive

boolean

已被取代 - 您可以藉由查詢 GraphUser 「_links」 字典的 「membershipState」 專案中所參考的 Graph 成員資格狀態來擷取

isAadIdentity

boolean

已被取代 - 可以從描述元的主旨類型推斷 (描述元.IsAadUserType/Descriptor.IsAadGroupType)

isContainer

boolean

已被取代 - 可以從描述元的主旨類型推斷 (描述元.IsGroupType)

isDeletedInOrigin

boolean

profileUrl

string

已被取代 - 不在 ToIdentityRef 的大部分預先存在實作中使用

uniqueName

string

已被取代 - 請改用 Domain+PrincipalName

url

string

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

PropertiesCollection

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

名稱 類型 Description
count

integer

集合中屬性的計數。

item

object

keys

string[]

集合中的索引鍵集合。

values

string[]

集合中的值集。

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

名稱 類型 Description
links

object

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