File tree Expand file tree Collapse file tree
Specialized Areas/Fix scripts/Cancel Struck Slack Conversations Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ This script will mark the struck slack conversation as canceled.
3+ Use Case: Sometimes due to n/w or connecton issue, users are not able to end the conversations using restart or end command from slack.
4+ Device Type in Encoded Query specify the source of conversation, slack in this case.
5+ */
6+ var struckConv = new GlideRecord ( 'sys_cs_conversation' ) ; // conversation table glide record
7+ struckConv . addEncodedQuery ( 'stateINopen,faulted,chatInProgress^device_type=slack' ) ; // Query can be enhanced based on user (consumer) or date range.
8+ struckConv . query ( ) ;
9+ while ( struckConv . next ( ) ) {
10+ struckConv . setValue ( 'state' , 'canceled' ) ; // set the state to cancel for struck conversation.
11+ struckConv . setWorkflow ( false ) ;
12+ struckConv . update ( ) ;
13+ }
You can’t perform that action at this time.
0 commit comments