logo

NJP

REST Message: Create an Incident and fetch the incident number and sys_id from target SN instance using POST HTTP method

Import · Oct 12, 2021 · article

Scenario: Create an Incident on the target SN instance and fetch the created incident number and sys_id from target to source SN instance using POST HTTP method.

1] In the source SN instance on the Incident form: Configure -> Form Layout -> Add Correlation ID and Correlation display fields

2] Create REST Message: specify the Target instance Incident table URL and create an Auth profile.

image

3] Create a POST HTTP method: specify the Endpoint, configure the HTTP headers and HTTP Query Parameters as shown below. Then click on Auto-generate variables.

image

4] Create Business Rule: When to run is set as async and only Insert is selected. This BR will trigger an Event, which in turn will call a Script Action

image

5] Create an Event: go to System Policy -> Events -> Registry -> New

image

6] Create Script Action: We have created a Script Action as we cannot use current.update() in any Business Rule

image

Regards,

Ritesh

View original source

https://www.servicenow.com/community/itsm-articles/rest-message-create-an-incident-and-fetch-the-incident-number/ta-p/2308321