Integration with Amazon SQS - how to import AWS SDK or CryptoJS libraries for server side coding?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2016 06:49 AM
I have a requirement to post a message on to AWS SQS when a certain type of incident occurs. The message payload is in a JSON format, and I have an ACCESS KEY, a SECRET KEY, a username and of course the AWS REGION and URL. What I can't figure out is how to build the v4 signature required to submit a message to AWS SQS.
Does anyone have insight on how to import either the AWS SDK or the CryptoJS libraries into ServiceNow in such a way that they can be used server-side to create such a message?
I attempted the method outlined in Mini-Lab: Adding Underscore.js Into ServiceNow without success, getting a Javascript parse error that prevents the library from being saved.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 01:13 PM
Quick question - did you install any loaders or other dependencies when you set this up? I'm reading through some webpack tutorials/doc and noticed a JSHint loader which could be helpful (going to do a bit more research on that one).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 07:10 AM
Sorry for the delay, have been out for the holidays!
I did not load anything additional, but this issue may be related to the ServiceNow version. There was an upgrade to the JavaScript engine in Helsinki that introduced support for ECMAScript 5 syntax. I'll try the same steps I took in a Geneva instance to see what happens.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 07:25 AM
That's encouraging, we are moving to Helsinki in the next couple weeks (have three systems to test / move). I'm looking forward to hearing if the SN version might be the issue. (and btw, I appreciate the point towards Webpack, did a bit of playing with that over the holidays!)
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2017 08:38 AM
Sad to report that installing Helsinki did not resolve the issue. As ServiceNow support indicated this wasn't a supported feature, I've opened an enhancement request for a path to add Javascript modules for use in server-side scripting.
We have taken the approach of installing the AWS SDK on a separate server and creating a REST request to that server, which then takes the SN information (incident sys_id, for example) and then formats and pushes the message to the Amazon SQS queue. It works, at the scale we are operating currently, but we will need a better solution long term as the amount of information we'll push will definitely increase.
I continue to explore / learn about webpack -- thanks so much for the reference -- and if I learn anything new about how to make this work I'll post here.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2017 08:46 AM
Sorry to hear that Helsinki did not clear this up, but thanks for the update! Would you mind emailing me the INT number at josh.nerius@servicenow.com? I'd like to gain a better understanding of support's findings.