Skip to content

Commit 9bdb77d

Browse files
authored
Create Update Inactive Application Owner.js
The script finds all application records where the owner is inactive and updates their owner to the corresponding manager, ensuring that ownership is correctly assigned to an active user.
1 parent b168e97 commit 9bdb77d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var grApp = new GlideRecord("cmdb_ci_appl");
2+
grApp.addEncodedQuery("owned_by.active=false");
3+
grApp.query();
4+
while(grApp.next()){
5+
var managerSysId = grApp.owned_by.manager.toString(); // Get Manager SysId
6+
if (managerSysId) {
7+
grApp.owned_by = managerSysId;
8+
grApp.update();
9+
}
10+
}

0 commit comments

Comments
 (0)