Giter VIP home page Giter VIP logo

servicenow-bot-example's Introduction

ServiceNow Bot for Slack Example

A sample bot for Slack that will search, create, and unfurl ServiceNow Incidents.

Demonstration

Search

servicenow-search

Create

servicenow-create

Unfurls

servicenow-unfurl

Configuration

Prerequisites

Environment Variables

Variable Value Description
PORT 3000 The HTTP Port to run the webserver on
SCOPE bot,commands The Slack OAuth scope to request
CLIENT_ID N/A The Slack OAuth Client Id code
CLIENT_SECRET N/A The Slack OAuth Client Secret code
TOKEN N/A The Slack Verification Token (optional)
STORE data/teams.json A string path to a filestore or a custom store object
SN_CLIENT_ID N/A ServiceNow OAuth Client ID
SN_CLIENT_SECRET N/A ServiceNow OAuth Client Secret
SN_LOGIN N/A ServiceNow Login
SN_PASSWORD N/A ServiceNow Password
SN_DOMAIN N/A ServiceNow Domain
SLASH_COMMAND incidents The Slash Command to trigger search and create

Running

npm start

Installing

Once the server is started, you will need to install the App on Slack to use it. To do so, navigate to [your url]/slack

servicenow-bot-example's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

servicenow-bot-example's Issues

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'bot' of undefined

Steps to reproduce:

  1. Created OAUTH on Slack and ServiceNow
  2. Updated all Environment Variables
  3. Created Slack side integration with the help of 'Slash commands'.
  4. Updated the Slack URL to the NodeJs application running in my local.

When I enter '/incidents create test-ticket' , It is hitting my app running locally.And seeing the error as below in the log.

Stack Trace:

[email protected] start /home/Slack/sampleAppBot
node index.js

Server Started
Express server listening on port 3002 in development mode
(node:1241) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'bot' of undefined
(node:1241) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I tried couple error handling ways for Promise but don't see it off.Any inputs to progress on this??

Thanks

Syntax Error?

Hi, I am getting an issue that looks like this:

(function (exports, require, module, __filename, __dirname) { const {PORT, SCOPE, CLIENT_ID, CLIENT_SECRET, TOKEN, STORE, SLASH_COMMAND} = process.env,
                                                                ^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:146:18)
at node.js:404:3

Any Ideas on how to fix it?

Thank you!

Just a slack query about permission

I just wanted to know what are the permission I have to provide to get this code working.

I have configured a slack bot current I am just listening to the im.message event.

And what are the "Select Permission Scopes" and "Event Subscriptions" configuration?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.