Skip to content

Commit 0d7f948

Browse files
authored
Cancel incident (#1028)
1 parent 2291cfe commit 0d7f948

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a ui action run on incident table which is client callable, run on condition current.state == '1' which means when state is new.It cancel the incident through the form.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function cancelIncident(){
2+
var gm = new GlideModal("glide_ask_standard", false, 600); // glide modal to get the confirmation
3+
gm.setPreference("title", "Are you sure you wanna cancel incident!!!");
4+
gm.setPreference("onPromptComplete", function() {
5+
gsftSubmit(null,g_form.getFormElement(),'cancel_incident');}); //calling same ui action
6+
gm.render();
7+
8+
}
9+
10+
if(typeof window == 'undefined'){
11+
serverCancel();
12+
}
13+
14+
function serverCancel(){
15+
current.state = '8'; //setting the state to canceled
16+
current.update();
17+
}

0 commit comments

Comments
 (0)