Skip to content

Commit 7d0cd6a

Browse files
authored
Create script.js
1 parent 6065b0b commit 7d0cd6a

File tree

1 file changed

+12
-0
lines changed
  • Specialized Areas/Fix scripts/Cacel Struck Slack Conversations

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
*/
5+
var struckConv = new GlideRecord('sys_cs_conversation'); // conversation table glide record
6+
struckConv.addEncodedQuery('stateINopen,faulted,chatInProgress^device_type=slack'); // Query can ve enhanced based on user (consumer) or date range.
7+
struckConv.query();
8+
while(struckConv.next()){
9+
struckConv.setValue('state','canceled'); // set the state to cancel for struck conversation.
10+
struckConv.setWorkflow(false);
11+
struckConv.update();
12+
}

0 commit comments

Comments
 (0)