Exception when trying to invoke a RESTMessage. OUTBOUND USAGE ANALYTICS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2018 06:34 AM
I have created a RestMessage and It's from working fine when i'm doing a TEST(UI Action). But when i'm trying to trigger that from a Script Include i'm getting below exception:
OUTBOUND USAGE ANALYTICS - OutboundUsageAnalytics : OutboundUsageAnalytics: Usage analytics send failed
Any let me know, if you have faced before or suggestion to avoid this exception.
Thanks in Advance!
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2018 09:01 AM
change it to trigger from a business rule (or have your business rule call the script include)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2018 02:02 PM
Did it work? I am getting exactly the same error.
I want to execute a Business Rule that triggers from the em_alert table and then sends the incident number back to the TrueSight event source using a REST API. I am testing, the Script Include using a Background script. The background script gets the latest glide record from the em_alert table.
I have tested the REST Message and it works fine and my logging shows that my background script is successfully fetching the latest TrueSight alert from ServiceNow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 11:41 AM
The OutboundUsageAnalytics message was a red herring. I got the errorMsg and found out RESTMessageV2 was failnig to resolve my hostname - so the httpStstus was 0. i.e. it never actually went to the REST API.
The key is: always use: response.getErrorMessage();
}
catch(ex) {
var message = ex.getMessage();
httpStatus = response.getStatusCode();
errorMsg = response.getErrorMessage();
}
if (httpStatus != 200) {
gs.info(logPrefix + 'httpStatus: ' + httpStatus + ', Error: ' + errorMsg);
}
return httpStatus;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2018 05:38 AM
That's an exception & at the same time i'm getting response as well. So i haven't done anything to resolve the exception.