Skip to content

Instantly share code, notes, and snippets.

@manvillej
Last active June 19, 2017 15:04
Show Gist options
  • Save manvillej/7265c231df393774021912c8ebdb2c12 to your computer and use it in GitHub Desktop.
Save manvillej/7265c231df393774021912c8ebdb2c12 to your computer and use it in GitHub Desktop.
the code for a business rule to respond to a slash command
(function executeRule(current, previous /*null when async*/) {
var slack = new SlackMessage();
slack.endpoint = current.u_response_url;
var response = slack.send("This application is prototype application to integrate Slack's slash commands & ServiceNow ");
// Show error message if it failed
if(response.getStatusCode() != 200) {
gs.addInfoMessage("response.getBody: " + response.getBody());
gs.addInfoMessage("response.getStatusCode: " + response.getStatusCode());
gs.addInfoMessage("response.getErrorMessage: " + response.getErrorMessage());
}
})(current, previous);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment