Slash Command - failed with error dispatch_failed
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 02:49 AM
Hi all, Iam trying to get the payload of slash command(/procurement) used in slack to servicenow log..But its showing error. as
/procurement failed with the error "dispatch_failed"'
Below is the scripted rest Api.
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
if (request.body.data.challenge){
response.setStatus(200);
response.setContentType('text/plain');
response.getStreamWriter().writeString(request.body.data.challenge);
}else{
if(request.body.data.event.text.contains('/procurement')){
gs.info('Slack Payload:'+ JSON.stringify(request.body.data));
}
}
})(request, response);
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 02:42 AM
@Mahesh23 no
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 01:18 PM
Hello, for anyone finding this thread in the future, I solved this issue by overriding the default supported request formats on the Scripted Rest Service record to allow application/x-www-form-urlencoded as follows.