Last active
June 19, 2017 15:04
-
-
Save manvillej/7265c231df393774021912c8ebdb2c12 to your computer and use it in GitHub Desktop.
the code for a business rule to respond to a slash command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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