Skip to content

Commit 8d866bd

Browse files
authored
Service now code snippet
1 parent 92c898d commit 8d866bd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(function executeRule(current, previous) {
2+
// Check if the state changed to "In Progress"
3+
if (current.state.changesTo(2)) { // Assuming 2 is the value for "In Progress"
4+
var grProblem = new GlideRecord('problem');
5+
grProblem.addQuery('incident', current.sys_id);
6+
grProblem.query();
7+
while (grProblem.next()) {
8+
grProblem.state = 2; // Assuming 2 is the value for "Work in Progress"
9+
grProblem.update();
10+
}
11+
}
12+
})(current, previous);

0 commit comments

Comments
 (0)