File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Business Rules/Validate CI on deployed assets Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ ( function executeRule ( current , previous /*null when async*/ ) {
2+
3+
4+ // Only act if asset is deployed and has no CI
5+ if ( current . install_status == 'Deployed' && ! current . ci ) {
6+ // Get the user assigned to the asset
7+ var userGR = new GlideRecord ( 'sys_user' ) ;
8+ if ( userGR . get ( current . assigned_to . toString ( ) ) ) {
9+ var manager = userGR . manager ;
10+ if ( manager ) {
11+ // Send notification to manager
12+ gs . eventQueue ( 'asset.ci.missing' , current , manager . toString ( ) , current . assigned_to . toString ( ) ) ;
13+ gs . info ( "[Asset-CI Check] Notification sent to manager: " + manager . name ) ;
14+ } else {
15+ gs . info ( "[Asset-CI Check] Assigned user has no manager." ) ;
16+ }
17+ } else {
18+ gs . info ( "[Asset-CI Check] Assigned user not found." ) ;
19+ }
20+ }
21+
22+
23+
24+ } ) ( current , previous ) ;
You can’t perform that action at this time.
0 commit comments