Skip to content

Commit a50af82

Browse files
authored
Create script.js
1 parent 075b194 commit a50af82

File tree

1 file changed

+25
-0
lines changed
  • Server-Side Components/Business Rules/Close State

1 file changed

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

0 commit comments

Comments
 (0)