Skip to content

Commit 97133fd

Browse files
authored
script.js
1 parent ebf1353 commit 97133fd

File tree

1 file changed

+20
-0
lines changed
  • Server-Side Components/Business Rules/Update Incident State To Closed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var pSysId = 'sys_id';
2+
var child= new GlideRecord('incident');
3+
child.addQuery('parent_incident',pSysId);
4+
child.query();
5+
var count=0;
6+
while(child.next()){
7+
8+
if(child.state!=7)
9+
{
10+
count =1;
11+
gs.print("your child incident is not there or is not yet closed");
12+
}
13+
}
14+
if(count==0){
15+
child.parent_incident.state=7;
16+
child.parent_incident.close_code='Duplicate';
17+
child.parent_incident.close_notes="done";
18+
child.parent_incident.update();
19+
gs.print("hello" + child.parent_incident.number);
20+
}

0 commit comments

Comments
 (0)