Example: Creating and Updating a Record using Go To Record Quick Action with Webhook Values (GAD)

This example shows you how to do the following tasks using the Go to Record Quick Action using webhook-supplied values:

When using Go to Record, when the record that we want to go to does not exist, this example shows you how to create a new record with the information provided in the Go to Record Quick Action.

Shows that the new record gets the focus by updating a value in the record using the Update a Record Quick Action.

How to supply all the values for Go to Record, creating the record, and Update a Record using a webhook.

The webhook values are stored in the Update Variables And Stored Values Quick Action for use in the actions. The Postman application is used as the REST-API client when sending the webhook POST request to the Execute endpoint.

Prerequisites

To use the Go to Record Quick Actions, set the global constant EnableActionService to True.

This example assumes you have administrator-level access to the Configuration console and are familiar with creating business objects and Quick Actions.

Three sets of tasks have to be completed before you can send an Execute request to webhooks in ITSM:

1.Create a Composite Action with the actions Update Variables And Stored Values, Go to Record, and Update a Record in an existing business object (we used the Project business object in this instance).

2.Create a webhook referring to the Composite Action created above.

3.Create an API Key to use as Authorization in the Execute POST request.

Executing the Webhook and Composite Action

Once all the prerequistes have been completed you can now execute the webhook and Composite Action.

1.Open Postman or a similar application that can send HTTP requests.

2.Create a POST request for the Execute Endpoint by providing a URL with EndpointExtension, an Authorization header and a JSON/XML body as per below.

In the POST request header, add your previously noted API Key as shown in the image.

Authorisation API Key in Headers section in Postman

Add the case sensitive Endpoint Extension on to the end of the POST URL: https://[your server]/api/rest/Webhooks/Execute?extension=WebH2. The POST URL is shown when creating the webhook.

In the JSON Body, send the values to be used by the Quick Action variable:

For example:

{

"gotonamevalue": "new record",

"summary": "summary updated",

"secondsummary": "summary updated second time"

}

HTTP POST request to send via postman

XML:

<xml>

<gotonamevalue>new record</gotonamevalue>

<summary>summary updated</summary>

<secondsummary>summary updated second time</secondsummary>

</xml>

XML version of Postman request

There should not be an existing record with the same value as the gotonamevalue in the Project workspace, Name column.

3.Click Send.

4.Verify that you received a Status 200 OK for a successful response in Postman.

5.In ITSM, open the Project workspace and check if a new record has been created using the fields and values in the Create a new Record section of the Go to Record action in step 12.

A new record with the webhook values sent via Postman should have been created with Name =new record.

The Summary of the record with the Name (gotonamevalue provided in the JSON/XML body) has been updated with the secondsummary value provided in the JSON/XML body (see step 2 in this section).

The Summary value for the new record has the value provided for the secondsummary field.

The Go to Record Quick Action creates a new record with the values from the webhook and GOES to that record. The Update a Record Quick Action then uses the value from the webhook secondsummary (see step 15) and updates the Summary value of the record.

Record has been created and updated with selected information using combined actions of actions blocks and webhook.