Megosztás a következőn keresztül:


Approvals - Update

Update status of an approval

PATCH https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/approvals/{approvalId}?api-version=7.1

URI Parameters

Name In Required Type Description
approvalId
path True

integer

int32

Id of the approval.

organization
path True

string

The name of the Azure DevOps organization.

project
path True

string

Project ID or project name

api-version
query True

string

Version of the API to use. This should be set to '7.1' to use this version of the api.

Request Body

Name Type Description
approvalType

ApprovalType

Gets or sets the type of approval.

approvedBy

IdentityRef

Gets the identity who approved.

approver

IdentityRef

Gets or sets the identity who should approve.

attempt

integer

Gets or sets attempt which specifies as which deployment attempt it belongs.

comments

string

Gets or sets comments for approval.

createdOn

string

Gets date on which it got created.

history

ReleaseApprovalHistory[]

Gets history which specifies all approvals associated with this approval.

id

integer

Gets the unique identifier of this field.

isAutomated

boolean

Gets or sets as approval is automated or not.

modifiedOn

string

Gets date on which it got modified.

rank

integer

Gets or sets rank which specifies the order of the approval. e.g. Same rank denotes parallel approval.

release

ReleaseShallowReference

Gets releaseReference which specifies the reference of the release to which this approval is associated.

releaseDefinition

ReleaseDefinitionShallowReference

Gets releaseDefinitionReference which specifies the reference of the release definition to which this approval is associated.

releaseEnvironment

ReleaseEnvironmentShallowReference

Gets releaseEnvironmentReference which specifies the reference of the release environment to which this approval is associated.

revision

integer

Gets the revision number.

status

ApprovalStatus

Gets or sets the status of the approval.

url

string

Gets url to access the approval.

Responses

Name Type Description
200 OK

ReleaseApproval

successful operation

Security

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.release_manage Grants the ability to read, update and delete release artifacts, including folders, releases, release definitions and release environment and the ability to queue and approve a new release.

Examples

Approve a release

Sample request

PATCH https://vsrm.dev.azure.com/fabrikam/MyFirstProject/_apis/release/approvals/{approvalId}?api-version=7.1

{
  "status": "approved",
  "comments": "Good to go!"
}

Sample response

{
  "id": 20,
  "revision": 1,
  "approver": {
    "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "displayName": "Chuck Reinhart",
    "uniqueName": "fabfiber@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
  },
  "approvedBy": {
    "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "displayName": "Chuck Reinhart",
    "uniqueName": "fabfiber@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
  },
  "approvalType": "preDeploy",
  "createdOn": "2017-05-31T18:07:40.45Z",
  "modifiedOn": "2017-05-31T18:08:09.577Z",
  "status": "approved",
  "comments": "Good to go!",
  "isAutomated": false,
  "isNotificationOn": true,
  "trialNumber": 1,
  "attempt": 1,
  "rank": 1,
  "history": [],
  "release": {
    "id": 3,
    "name": "Release-3",
    "url": "https://vsrm.dev.azure.com/fabrikam/MyFirstProject/_apis/Release/releases/3",
    "_links": {}
  },
  "releaseDefinition": {
    "id": 1,
    "name": "MyShuttle.CD",
    "url": "https://vsrm.dev.azure.com/fabrikam/d07908bc-118f-47d2-8a13-ff75601a6b1a/_apis/Release/definitions/1",
    "_links": {}
  },
  "releaseEnvironment": {
    "id": 9,
    "name": "Dev",
    "_links": {}
  },
  "url": "https://vsrm.dev.azure.com/fabrikam/MyFirstProject/_apis/Release/approvals/20"
}

Definitions

Name Description
ApprovalStatus

Gets or sets the status of the approval.

ApprovalType

Gets or sets the type of approval.

IdentityRef
ProjectReference
ReferenceLinks

The class to represent a collection of REST reference links.

ReleaseApproval
ReleaseApprovalHistory
ReleaseDefinitionShallowReference
ReleaseEnvironmentShallowReference
ReleaseShallowReference

ApprovalStatus

Gets or sets the status of the approval.

Name Type Description
approved

string

Indicates the approval is approved.

canceled

string

Indicates the approval is canceled.

pending

string

Indicates the approval is pending.

reassigned

string

Indicates the approval is reassigned.

rejected

string

Indicates the approval is rejected.

skipped

string

Indicates the approval is skipped.

undefined

string

Indicates the approval does not have the status set.

ApprovalType

Gets or sets the type of approval.

Name Type Description
all

string

Indicates all approvals.

postDeploy

string

Indicates the approvals which executed after deployment.

preDeploy

string

Indicates the approvals which executed before deployment.

undefined

string

Indicates the approval type does not set.

IdentityRef

Name Type Description
_links

ReferenceLinks

This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.

descriptor

string

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

directoryAlias

string

Deprecated - Can be retrieved by querying the Graph user referenced in the "self" entry of the IdentityRef "_links" dictionary

displayName

string

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

id

string

imageUrl

string

Deprecated - Available in the "avatar" entry of the IdentityRef "_links" dictionary

inactive

boolean

Deprecated - Can be retrieved by querying the Graph membership state referenced in the "membershipState" entry of the GraphUser "_links" dictionary

isAadIdentity

boolean

Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)

isContainer

boolean

Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)

isDeletedInOrigin

boolean

profileUrl

string

Deprecated - not in use in most preexisting implementations of ToIdentityRef

uniqueName

string

Deprecated - use Domain+PrincipalName instead

url

string

This url is the full route to the source resource of this graph subject.

ProjectReference

Name Type Description
id

string

Gets the unique identifier of this field.

name

string

Gets name of project.

The class to represent a collection of REST reference links.

Name Type Description
links

object

The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.

ReleaseApproval

Name Type Description
approvalType

ApprovalType

Gets or sets the type of approval.

approvedBy

IdentityRef

Gets the identity who approved.

approver

IdentityRef

Gets or sets the identity who should approve.

attempt

integer

Gets or sets attempt which specifies as which deployment attempt it belongs.

comments

string

Gets or sets comments for approval.

createdOn

string

Gets date on which it got created.

history

ReleaseApprovalHistory[]

Gets history which specifies all approvals associated with this approval.

id

integer

Gets the unique identifier of this field.

isAutomated

boolean

Gets or sets as approval is automated or not.

modifiedOn

string

Gets date on which it got modified.

rank

integer

Gets or sets rank which specifies the order of the approval. e.g. Same rank denotes parallel approval.

release

ReleaseShallowReference

Gets releaseReference which specifies the reference of the release to which this approval is associated.

releaseDefinition

ReleaseDefinitionShallowReference

Gets releaseDefinitionReference which specifies the reference of the release definition to which this approval is associated.

releaseEnvironment

ReleaseEnvironmentShallowReference

Gets releaseEnvironmentReference which specifies the reference of the release environment to which this approval is associated.

revision

integer

Gets the revision number.

status

ApprovalStatus

Gets or sets the status of the approval.

url

string

Gets url to access the approval.

ReleaseApprovalHistory

Name Type Description
approver

IdentityRef

Identity of the approver.

changedBy

IdentityRef

Identity of the object who changed approval.

comments

string

Approval history comments.

createdOn

string

Time when this approval created.

modifiedOn

string

Time when this approval modified.

revision

integer

Approval history revision.

ReleaseDefinitionShallowReference

Name Type Description
_links

ReferenceLinks

Gets the links to related resources, APIs, and views for the release definition.

id

integer

Gets the unique identifier of release definition.

name

string

Gets or sets the name of the release definition.

path

string

Gets or sets the path of the release definition.

projectReference

ProjectReference

Gets or sets project reference.

url

string

Gets the REST API url to access the release definition.

ReleaseEnvironmentShallowReference

Name Type Description
_links

ReferenceLinks

Gets the links to related resources, APIs, and views for the release environment.

id

integer

Gets the unique identifier of release environment.

name

string

Gets or sets the name of the release environment.

url

string

Gets the REST API url to access the release environment.

ReleaseShallowReference

Name Type Description
_links

ReferenceLinks

Gets the links to related resources, APIs, and views for the release.

id

integer

Gets the unique identifier of release.

name

string

Gets or sets the name of the release.

url

string

Gets the REST API url to access the release.