Skip to content

Commit a8fe7ba

Browse files
authored
Create script.js
1 parent 69c730d commit a8fe7ba

File tree

1 file changed

+22
-0
lines changed
  • Specialized Areas/CMDB/UnsyncCI from Asset

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
unsyncCI();
2+
3+
function unsyncCI() {
4+
5+
var grAsset = new GlideRecord("alm_hardware");
6+
grAsset.addEncodedQuery('sys_id='); //replace query with rrequired list
7+
grAsset.query();
8+
if (grAsset.next()) {
9+
var grCI = new GlideRecord("cmdb_ci");
10+
grCI.addQuery("sys_id", grAsset.ci);
11+
grCI.setLimit(1);
12+
grCI.query();
13+
if (grCI.next()) {
14+
grCI.asset = '';
15+
grCI.setWorkFlow(false);
16+
grCI.update();
17+
}
18+
grAsset.ci = '';
19+
grAsset.setWorkFlow(false);
20+
grAsset.update();
21+
}
22+
}

0 commit comments

Comments
 (0)