File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Scheduled Jobs/Unpublish Public Reports Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1+ Scheduled Job to query the report table for any reports that are Published or roles are set to Public and remove the public role from report.
Original file line number Diff line number Diff line change 1+ var pubReport = new GlideRecord ( 'sys_report' ) ;
2+ pubReport . addQuery ( 'is_published=true^ORroles=public' ) ;
3+ pubReport . query ( ) ;
4+ while ( pubReport . next ( ) ) {
5+ //Obtain current roles report is shared with
6+ var removePublic = pubReport . roles ;
7+ //Remove public role from string
8+ removePublic = removePublic . replace ( / p u b l i c / g, '' ) ;
9+ //Set report roles to new string value. Wihtout public role, report will auto unpublish
10+ pubReport . roles . setValue ( removePublic ) ;
11+ pubReport . update ( ) ;
12+ }
You can’t perform that action at this time.
0 commit comments