Pull Request Statuses - Create

끌어오기 요청 상태 만듭니다.

상태 유일한 필수 필드는 상태 Context.Name 고유하게 식별하는 것입니다. 요청 본문에서 iterationId를 지정하여 반복에 상태 게시할 수 있습니다.

POST https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses?api-version=4.1-preview.1

URI 매개 변수

Name In(다음 안에) 필수 형식 Description
organization
path True

string

Azure DevOps 조직의 이름입니다.

pullRequestId
path True

integer

int32

끌어오기 요청의 ID입니다.

repositoryId
path True

string

끌어오기 요청의 대상 분기의 리포지토리 ID입니다.

project
path

string

프로젝트 ID 또는 프로젝트 이름

api-version
query True

string

사용할 API의 버전입니다. 이 API 버전을 사용하려면 '4.1-preview.1'로 설정해야 합니다.

요청 본문

Name 형식 Description
_links

ReferenceLinks

참조 링크입니다.

context

GitStatusContext

상태 컨텍스트입니다.

createdBy

IdentityRef

상태 만든 ID입니다.

creationDate

string

상태 생성 날짜 및 시간입니다.

description

string

상태 설명입니다. 일반적으로 상태 현재 상태를 설명합니다.

id

integer

상태 식별자입니다.

iterationId

integer

상태 연결할 반복의 ID입니다. 최솟값은 1입니다.

properties

PropertiesCollection

상태 사용자 지정 속성입니다.

state

GitStatusState

상태 상태입니다.

targetUrl

string

상태 세부 정보가 있는 URL입니다.

updatedDate

string

상태 마지막 업데이트 날짜 및 시간입니다.

응답

Name 형식 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

Name Description
vso.code_write 소스 코드를 읽고, 업데이트하고, 삭제하고, 커밋, 변경 집합, 분기 및 기타 버전 제어 아티팩트에 대한 메타데이터에 액세스하는 기능을 부여합니다. 또한 끌어오기 요청 및 코드 검토를 만들고 관리하고 서비스 후크를 통해 버전 제어 이벤트에 대한 알림을 받을 수 있는 기능을 부여합니다.
vso.code_status 커밋 및 끌어오기 요청 상태 읽고 쓸 수 있는 기능을 부여합니다.

예제

On iteration
On pull request
With properties

On iteration

Sample Request

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

{
  "iterationId": 1,
  "state": "succeeded",
  "description": "Sample status succeeded",
  "context": {
    "name": "sample-status-2",
    "genre": "vsts-samples"
  },
  "targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1"
}

Sample Response

{
  "iterationId": 1,
  "id": 1,
  "state": "succeeded",
  "description": "Sample status succeeded",
  "context": {
    "name": "sample-status-2",
    "genre": "vsts-samples"
  },
  "creationDate": "2017-09-19T14:50:26.4429056Z",
  "updatedDate": "2017-09-19T14:50:26.4429056Z",
  "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/2/statuses/1"
    },
    "repository": {
      "href": "https://dev.azure.com/fabrikam/_apis/git/repositories/b92c8408-a0c9-4292-88af-bc005a1b8272"
    }
  }
}

On pull request

Sample Request

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

{
  "state": "succeeded",
  "description": "Sample status succeeded",
  "context": {
    "name": "sample-status-4",
    "genre": "vsts-samples"
  },
  "targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1"
}

Sample Response

{
  "id": 1,
  "state": "succeeded",
  "description": "Sample status succeeded",
  "context": {
    "name": "sample-status-4",
    "genre": "vsts-samples"
  },
  "creationDate": "2017-09-19T14:50:25.1680228Z",
  "updatedDate": "2017-09-19T14:50:25.1680228Z",
  "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/1/statuses/1"
    },
    "repository": {
      "href": "https://dev.azure.com/fabrikam/_apis/git/repositories/b92c8408-a0c9-4292-88af-bc005a1b8272"
    }
  }
}

With properties

Sample Request

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

{
  "properties": {
    "sampleId": 7,
    "customInfo": "Custom status information",
    "startedDateTime": {
      "$type": "System.DateTime",
      "$value": "2017-09-19T14:50:26.7410146Z"
    },
    "weight": {
      "$type": "System.Double",
      "$value": 1.75
    },
    "bytes": {
      "$type": "System.Byte[]",
      "$value": "dGhpcyBpcyBzYW1wbGUgYmFzZTY0IGVuY29kZWQgc3RyaW5n"
    },
    "globalId": {
      "$type": "System.Guid",
      "$value": "1e788cb9-9d3d-4dc6-ac05-822092d17f90"
    }
  },
  "state": "succeeded",
  "description": "Sample status succeeded",
  "context": {
    "name": "sample-status-1",
    "genre": "vsts-samples"
  },
  "targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1"
}

Sample Response

{
  "properties": {
    "bytes": {
      "$type": "System.Byte[]",
      "$value": "dGhpcyBpcyBzYW1wbGUgYmFzZTY0IGVuY29kZWQgc3RyaW5n"
    },
    "customInfo": {
      "$type": "System.String",
      "$value": "Custom status information"
    },
    "globalId": {
      "$type": "System.String",
      "$value": "1e788cb99d3d4dc6ac05822092d17f90"
    },
    "sampleId": {
      "$type": "System.Int32",
      "$value": 7
    },
    "startedDateTime": {
      "$type": "System.DateTime",
      "$value": "2017-09-19T14:50:26.74Z"
    },
    "weight": {
      "$type": "System.Double",
      "$value": 1.75
    }
  },
  "id": 1,
  "state": "succeeded",
  "description": "Sample status succeeded",
  "context": {
    "name": "sample-status-1",
    "genre": "vsts-samples"
  },
  "creationDate": "2017-09-19T14:50:26.7780242Z",
  "updatedDate": "2017-09-19T14:50:26.7780242Z",
  "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/3/statuses/1"
    },
    "repository": {
      "href": "https://dev.azure.com/fabrikam/_apis/git/repositories/b92c8408-a0c9-4292-88af-bc005a1b8272"
    }
  }
}

정의

Name Description
GitPullRequestStatus

이 클래스는 끌어오기 요청 상태 게시하는 서비스/확장의 메타데이터를 포함합니다. 상태는 끌어오기 요청 또는 반복과 연결할 수 있습니다.

GitStatusContext

상태 고유하게 식별하는 상태 컨텍스트입니다.

GitStatusState

상태 상태입니다.

IdentityRef
PropertiesCollection

클래스는 키-값 쌍의 컬렉션으로 속성 모음을 나타냅니다. 를 제외한 모든 기본 형식의 값(을 TypeCode != TypeCode.Object제외한 DBNull 모든 형식)이 허용됩니다. Byte[], Int32, Double, DateType 및 String 형식의 값은 해당 형식을 유지하며 다른 기본 형식은 String으로 다시 조정됩니다. byte[] base64로 인코딩된 문자열로 예상됩니다.

ReferenceLinks

REST 참조 링크의 컬렉션을 나타내는 클래스입니다.

GitPullRequestStatus

이 클래스는 끌어오기 요청 상태 게시하는 서비스/확장의 메타데이터를 포함합니다. 상태는 끌어오기 요청 또는 반복과 연결할 수 있습니다.

Name 형식 Description
_links

ReferenceLinks

참조 링크입니다.

context

GitStatusContext

상태 컨텍스트입니다.

createdBy

IdentityRef

상태 만든 ID입니다.

creationDate

string

상태 생성 날짜 및 시간입니다.

description

string

상태 설명입니다. 일반적으로 상태 현재 상태를 설명합니다.

id

integer

상태 식별자입니다.

iterationId

integer

상태 연결할 반복의 ID입니다. 최솟값은 1입니다.

properties

PropertiesCollection

상태 사용자 지정 속성입니다.

state

GitStatusState

상태 상태입니다.

targetUrl

string

상태 세부 정보가 있는 URL입니다.

updatedDate

string

상태 마지막 업데이트 날짜 및 시간입니다.

GitStatusContext

상태 고유하게 식별하는 상태 컨텍스트입니다.

Name 형식 Description
genre

string

상태 장르. 일반적으로 상태 생성하는 서비스/도구의 이름은 비어 있을 수 있습니다.

name

string

상태 이름 식별자는 null이거나 비워 둘 수 없습니다.

GitStatusState

상태 상태입니다.

Name 형식 Description
error

string

오류가 있는 상태입니다.

failed

string

상태가 실패했습니다.

notApplicable

string

상태는 대상 개체에 적용되지 않습니다.

notSet

string

상태 상태가 설정되지 않았습니다. 기본 상태입니다.

pending

string

보류 중인 상태입니다.

succeeded

string

상태가 성공했습니다.

IdentityRef

Name 형식 Description
_links

ReferenceLinks

이 필드에는 그래프 제목에 대한 0개 이상의 흥미로운 링크가 포함되어 있습니다. 이러한 링크를 호출하여 이 그래프 제목에 대한 추가 관계 또는 자세한 정보를 얻을 수 있습니다.

descriptor

string

설명자는 시스템이 실행되는 동안 그래프 제목을 참조하는 기본 방법입니다. 이 필드는 계정과 조직 모두에서 동일한 그래프 제목을 고유하게 식별합니다.

directoryAlias

string

displayName

string

그래프 주체의 고유하지 않은 표시 이름입니다. 이 필드를 변경하려면 원본 공급자에서 해당 값을 변경해야 합니다.

id

string

imageUrl

string

inactive

boolean

isAadIdentity

boolean

isContainer

boolean

profileUrl

string

uniqueName

string

url

string

이 URL은 이 그래프 주체의 원본 리소스에 대한 전체 경로입니다.

PropertiesCollection

클래스는 키-값 쌍의 컬렉션으로 속성 모음을 나타냅니다. 를 제외한 모든 기본 형식의 값(을 TypeCode != TypeCode.Object제외한 DBNull 모든 형식)이 허용됩니다. Byte[], Int32, Double, DateType 및 String 형식의 값은 해당 형식을 유지하며 다른 기본 형식은 String으로 다시 조정됩니다. byte[] base64로 인코딩된 문자열로 예상됩니다.

Name 형식 Description
count

integer

컬렉션의 속성 수입니다.

item

object

keys

string[]

컬렉션의 키 집합입니다.

values

string[]

컬렉션의 값 집합입니다.

REST 참조 링크의 컬렉션을 나타내는 클래스입니다.

Name 형식 Description
links

object

링크의 읽기 전용 보기입니다. 참조 링크는 읽기 전용이므로 읽기 전용으로만 노출하려고 합니다.