File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Specialized Areas/CMDB/UnsyncCI from Asset Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ Fix script to unsync a Asset from a CI . OOB the field is read only, this allows admin to unsync when required.
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments