Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UI Actions/Cancel Incident/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +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.
17 changes: 17 additions & 0 deletions UI Actions/Cancel Incident/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
function cancelIncident(){
var gm = new GlideModal("glide_ask_standard", false, 600); // glide modal to get the confirmation
gm.setPreference("title", "Are you sure you wanna cancel incident!!!");
gm.setPreference("onPromptComplete", function() {
gsftSubmit(null,g_form.getFormElement(),'cancel_incident');}); //calling same ui action
gm.render();

}

if(typeof window == 'undefined'){
serverCancel();
}

function serverCancel(){
current.state = '8'; //setting the state to canceled
current.update();
}