We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06c5594 commit 39c16c9Copy full SHA for 39c16c9
Server-Side Components/Business Rules/Set CI to In Maintenance on Change start/Script.js
@@ -0,0 +1,15 @@
1
+(function executeRule(current, previous) {
2
+ if (previous.state != current.state && current.state == 'implement') {
3
+ var ciRel = new GlideRecord('task_ci');
4
+ ciRel.addQuery('task', current.sys_id);
5
+ ciRel.query();
6
+ while (ciRel.next()) {
7
+ var ci = new GlideRecord('cmdb_ci');
8
+ if (ci.get(ciRel.ci_item)) {
9
+ ci.install_status = 4; // In Maintenance
10
+ ci.update();
11
+ gs.info('CI ' + ci.name + ' moved to In Maintenance.');
12
+ }
13
14
15
+})(current, previous);
0 commit comments