Question regarding executeAsync() RESTMessageV2 in outbound

Palle
Tera Contributor

Hi Community,

I have created an asynchronous business rule to trigger a REST Message which execute asynchronously (using executeAsync() method) to create a ticket in third party system. As per my understanding any lines after  executeAsync() method will not work. But, in my case I had defined getStatusCode and getBody methods in the script after executeAsync(), and I am able to parse the response. How is this possible? I am missing something? or my understanding is incorrect?

Thanks

 

6 REPLIES 6

Palle
Tera Contributor

Hi Suvro, 

I did looked at the article and assumed the response cannot be handled when using executeAsync() method, but I am able to parse the response and update the incident objects.

 

When you use executeAync but then call methods like waitForResponse, getBody, or getStatusCode the request turns synchronous automatically, even if you use executeAsync.

RamonCordova_1-1730239124561.png


For your reference:

Best practices for handling scriptable outbound REST and SOAP messages on the Now Platform - Support...

Outbound Integrations Using SOAP / REST: Performan... - ServiceNow Community