Create the REST Action
The rest action will be used in a FLOW, usually after approvals, so that SNOW can pass the user submited variables and start an Azure DevOps pipeline.
Inputs
We need to capture the RITM number so that we can pass it to our script in order for it to update the user by adding comments or by setting the status to completed.
In this example we are adding a user to a group in Active Directory so we also need to capture the username and the security group.

REST Action
Select the connection alias that was created earlier. In the request details select manually and add the URI of your AzDo pipeline, it is usually a number. In my case it is _apis/pipelines/693/runs. The resource path will be concatenated with the base url from the connection alias and should be something like:
https://dev.azure.com/company/project/_apis/pipelines/693/runs
We will be using post for our HTTP method. For Azure DevOps you must specify the api-version. ServiceNow provides a text box for the body of the request so you must add the accept and content-type headers so that the text will be posted as JSON.

Scroll down to build the request content. This will be the body of the request and will instruct AzDo on which branch of the repo to run and which variables to receive.

You can build the body of your JSON doc and then drag and drop your input variables into your dictionary values. It is recommended to match the input variable name here to better understand and match.

Lastly we should create an output variable to capture the HTTP result of the REST call so that we can do validation and error checking during our flow.

Save the action and test it. If all is ok you will get a 200 status code back. Check other rest status codes here: https://www.restapitutorial.com/httpstatuscodes.html
