Delen via


Approvals - Update

Update approvals.

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

URI Parameters

Name In Required Type Description
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
body

ApprovalUpdateParameters[]

Responses

Name Type Description
200 OK

Approval[]

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.build_execute Grants the ability to access build artifacts, including build results, definitions, and requests, and the ability to queue a build, update build properties, and the ability to receive notifications about build events via service hooks.
vso.pipelineresources_use Grants the ability to approve a pipeline's request to use a protected resource: agent pool, environment, queue, repository, secure files, service connection, and variable group

Examples

Sample request

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

[
  {
    "approvalId": "aab27959-a5be-4ee3-97ca-f19b3602cd2f",
    "comment": "Approving",
    "status": "approved"
  }
]

Sample response

request-Context: appId=cid-v1:a892bfef-0287-4640-9f5e-cffc90fbcf94
access-Control-Expose-Headers: Request-Context
{
  "count": 1,
  "value": [
    {
      "id": "aab27959-a5be-4ee3-97ca-f19b3602cd2f",
      "steps": [
        {
          "assignedApprover": {
            "displayName": "User Name",
            "id": "3b3db741-9d03-4e32-a7c0-6c3dfc2013c1",
            "uniqueName": "uniqueName",
            "descriptor": "Descriptor"
          },
          "actualApprover": {
            "displayName": "User Name",
            "id": "3b3db741-9d03-4e32-a7c0-6c3dfc2013c1",
            "uniqueName": "uniqueName",
            "descriptor": "Descriptor"
          },
          "status": "approved",
          "comment": "Approving",
          "lastModifiedOn": "2020-11-19T09:57:54.252505Z",
          "order": 1,
          "lastModifiedBy": {
            "displayName": "User Name",
            "id": "3b3db741-9d03-4e32-a7c0-6c3dfc2013c1",
            "uniqueName": "uniqueName",
            "descriptor": "Descriptor"
          },
          "initiatedOn": "2020-11-19T09:51:16.7045043Z",
          "history": []
        }
      ],
      "status": "approved",
      "createdOn": "2020-11-19T09:51:16.703Z",
      "lastModifiedOn": "2020-11-19T09:57:54.252505Z",
      "executionOrder": "anyOrder",
      "minRequiredApprovers": 1,
      "blockedApprovers": [],
      "_links": {
        "self": {
          "href": "https://dev.azure.com/fabrikam/d6b3e0ea-8197-4dec-831b-50e2e06ff95f/_apis/pipelines/approvals/aab27959-a5be-4ee3-97ca-f19b3602cd2f"
        }
      }
    }
  ]
}

Definitions

Name Description
Approval
ApprovalExecutionOrder

Order in which approvers will be actionable.

ApprovalPermissions

Current user permissions for approval object.

ApprovalStatus

Overall status of the approval.

ApprovalStep

Data for a single approval step.

ApprovalStepHistory

Data for a single approval step history.

ApprovalUpdateParameters

Data to update an approval object or its individual step.

IdentityRef
ReferenceLinks

The class to represent a collection of REST reference links.

Approval

Name Type Description
_links

ReferenceLinks

/// Gets the links to access the approval object.

blockedApprovers

IdentityRef[]

Identities which are not allowed to approve.

createdOn

string

Date on which approval got created.

executionOrder

ApprovalExecutionOrder

Order in which approvers will be actionable.

id

string

Unique identifier of the approval.

instructions

string

Instructions for the approvers.

lastModifiedOn

string

Date on which approval was last modified.

minRequiredApprovers

integer

Minimum number of approvers that should approve for the entire approval to be considered approved.

permissions

ApprovalPermissions

Current user permissions for approval object.

status

ApprovalStatus

Overall status of the approval.

steps

ApprovalStep[]

List of steps associated with the approval.

ApprovalExecutionOrder

Order in which approvers will be actionable.

Name Type Description
anyOrder

string

Indicates that the approvers can approve in any order.

inSequence

string

Indicates that the approvers can only approve in a sequential order(Order in which they were assigned).

ApprovalPermissions

Current user permissions for approval object.

Name Type Description
none

string

queueBuild

string

reassign

string

resourceAdmin

string

update

string

view

string

ApprovalStatus

Overall status of the approval.

Name Type Description
all

string

approved

string

Indicates the approval is Approved.

canceled

string

Indicates the approval is Canceled.

completed

string

failed

string

pending

string

Indicates the approval is Pending.

rejected

string

Indicates the approval is Rejected.

skipped

string

Indicates the approval is Skipped.

timedOut

string

Indicates the approval is Timed out.

undefined

string

uninitiated

string

Indicates the approval is Uninitiated. Used in case of in sequence order of execution where given approver is not yet actionable.

ApprovalStep

Data for a single approval step.

Name Type Description
actualApprover

IdentityRef

Identity who approved.

assignedApprover

IdentityRef

Identity who should approve.

comment

string

Comment associated with this step.

history

ApprovalStepHistory[]

History of the approval step

initiatedOn

string

Timestamp at which this step was initiated.

lastModifiedBy

IdentityRef

Identity by which this step was last modified.

lastModifiedOn

string

Timestamp at which this step was last modified.

order

integer

Order in which the approvers are allowed to approve.

permissions

ApprovalPermissions

Current user permissions for step.

status

ApprovalStatus

Current status of this step.

ApprovalStepHistory

Data for a single approval step history.

Name Type Description
assignedTo

IdentityRef

Identity who was assigned this approval

comment

string

Comment associated with this step history.

createdBy

IdentityRef

Identity by which this step history was created.

createdOn

string

Timestamp at which this step history was created.

ApprovalUpdateParameters

Data to update an approval object or its individual step.

Name Type Description
approvalId

string

ID of the approval to be updated.

assignedApprover

IdentityRef

Current approver.

comment

string

Gets or sets comment.

reassignTo

IdentityRef

Reassigned Approver.

status

ApprovalStatus

Gets or sets status.

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.

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.