Forum Discussion

jaylvee's avatar
jaylvee
Copper Contributor
Nov 10, 2023

REST API example for Check Configurations Query - Check Task

The REST call for this is documented here - https://learn.microsoft.com/en-us/rest/api/azure/devops/approvalsandchecks/check-configurations/query?view=azure-devops-rest-7.2&tabs=HTTP

 

However, there are no examples on how to use the "Check Task" type.  This type is for Gates in the pipeline.  There are few if any places to find which pipelines use Gates.   I am able to use the 'Environment' type and using the Environment ID.   

 

Please provide an example of what verbiage to use for the Check Task type and in the scenario where there is an Azure DevOps extension used as a gate.

1 Reply

  • How about this:

     

    For querying check configurations using the REST API:

    POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/check-configurations/query?api-version=7.2-preview.1
    Content-Type: application/json
    Authorization: Bearer {PAT or System.AccessToken}

     

    Request Body:

    {
      "type": "CheckTask",
      "resourceType": "pipeline",
      "resourceId": "{pipelineId}"
    }

    Replace {pipelineId} with the actual pipeline ID where the gate is configured.

Resources