Home

Awesome

This project is aimed at bridging Spark and Service now via Spark bot technology.

Deploy to Heroku

Deploy

Getting Started

Create a Development ServiceNow User to Authenticate Your Bot

  1. Login to your ServiceNow instance.
  2. Using the "Filter Navigator" search bar, search for "Users"
  3. Click on the "Users" link under "User Administration"
  4. Click on the "New" button in the top navigation bar
  5. Create a user and specify a User ID and Password

Create the Bot

Setup Your Project's Environment Variables

Setup a Public Address Through ngrok

To actually get the bot up and running, a public address is required. We used ngrok in order to create a public address that can be utilized.

Build and Run

You should now be able to communicate with the bot from within Cisco Spark.


Bot Commands - How to Talk With Your Bot

Create

View

Update


Alerting

To enable your bot to receive update alerts from ServiceNow you must add a Business Rule.

  1. Login to your ServiceNow instance.
  2. Using the "Filter Navigator" search bar, search for "Business Rules"
  3. Click on the "Business Rules" link under "System Definition"
  4. Click on the "New" button in the top navigation bar
  5. Enter a unique name that you can use to find your Business Rule in the future
  6. Select the table you wish to receive alerts about from the "Table" dropdown
  7. Check the "Advanced" checkbox
  8. In the "When to run" tab:
    1. Set the "When" dropdown to "after"
    2. Select the appropriate actions from the available action checkboxes (insert, update, delete, query) you want to run the trigger on
  9. In the "Advanced" tab: 4. Enter the code that will make a request whenever a change is triggered: 1. See our examples for writing Business Rules 2. Note: You will have to update the call to setEndpoint in order to pass in the public address of your bot
  10. Submit the Business Rule

Creating new skills

In order to create additional functionality for the bot, you will have to create a new skill that listens to a particular message and acts accordingly. The existing skills can be found in the src/skills directory. The project is set up in a way that any skills located within this directory will be registered with the Spark bot.

Within a newly created skill, you will need to call .hears and provide a regex pattern that will match a certain message the user sends to the bot in Spark, as well as a callback that will fire when the message is received. The callback takes both the bot and the message.

In order to have the bot send a message to the user, you can use the bot's .reply(message, "custom message") function, which takes the original message and your bot's response.

To communicate with ServiceNow, you can use the service_now_client.js in order to make calls to the Table API. Using this class, you can retrieve, create, and update records within tables in ServiceNow.