How to use "Cloud Rest - Add Response to Context"

Aidan
Tera Guru

Hi

I'm trying to build a new pattern to discover some Azure resources.  I've got the pattern working up to a point, but now deciding how to call the API and parse the results.  I've looked at the existing Azure patterns and tried to copy the model but its not working when using the "Cloud Rest - Add Response to Context" step.

If I use the "Cloud REST Call" step then I get the response back okay, however using the Add Response to Context gives me the following error;

Test failed: Custom operation Cloud REST - add response to context failed to execute script due to Custom operation Failed to run script due to the following error: JAVASCRIPT_CODE_FAILURE: Cannot convert null to an object.. Check the discovery logs for more details.

Cannot find how to use this step and then the subsequent parse columns.

Any help appreciated...

1 ACCEPTED SOLUTION

ServiceNow Tec2
Mega Sage
This has been resolved by ServiceNow Technical Support. Please refer to KB1009041 for more information.

View solution in original post

5 REPLIES 5

ServiceNow Tec2
Mega Sage
This has been resolved by ServiceNow Technical Support. Please refer to KB1009041 for more information.

Rob50
Tera Contributor

Hey @Aidan, I've got a similar problem. Looking at the docs that are linked in the answer did you add the functions into the Custom Operations "Cloud REST - add response to context", based on the schema of the response from Azure?

Cheers,

Rob

Hi @Rob50 , been a while since I had this problem, but I remember that in the end I didn't have to change anything, I believe it was fixed in a patch/upgrade.

Rob50
Tera Contributor

I can see from other patterns that the set Parameter step is used and the EVAL function to process the data. I am using the "Parse response columns" library which has this step pre-defined, but I am still seeing the same error. Can you elaborate on whether you configured any additional steps @Aidan @ServiceNow Tec2