Skip to content

Commit 863a804

Browse files
authored
Close child incident (ServiceNowDevProgram#739)
* Create clientScript.js in close child incident * Create serverScript.js on close child incident * Create readme.md on close child incident
1 parent 3e783cd commit 863a804

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function popUpClientScript(){
2+
var answer = confirm('Are you sure you want to close the attached child incident'); // confirm message to ask for confirmation
3+
if(answer == true){ //check if answer is true
4+
gsftSubmit(null,g_form.getFormElement(),'sys_demoaction'); // calling server ui action to update state
5+
}
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This is a ui actions that close the child incident directly from the parent incident
2+
3+
Two actions for this :
4+
1. Client side ui action from which button is shown and onClick of that button server side action will be performed
5+
2. Server side ui action that update the state of that child incident to closed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var gr = new GlideRecord('incident');
2+
gr.addQuery('parent_incident',current.sys_id); //querying over particular parent incident
3+
gr.query();
4+
while(gr.next()){
5+
gr.state = '7'; //updating the state of the child incident to closed
6+
gr.update();
7+
}

0 commit comments

Comments
 (0)