Notifications

9 views

Description


To hide retired business services for certain role, we can use a before-query business rule that filters business services with retired operational status based on role.

Procedure


Below code was written to query Business Service table with 'Operational Status' is not 'Retired' to display for 'itil' role users

Code was developed based on OOB configuration, please feel free to perform necessary changes to the code (eg. Operational Status value for 'retired' based on your environment) 

 

Create a before-query business rule

Name: Hide Retired Business Services

Table: Business Service (cmdb_ci_service) 

When:Before

Query: True

Script:

(function executeRule(current, previous /*null when async*/) {

if (!gs.hasRole("admin") && gs.hasRole("itil") && gs.isInteractive()) {

var qc = current.addEncodedQuery('operational_status!=6'); // '6' is status value of Retired in OOB
}

})(current, previous);

 

Applicable Versions


All Versions

 

Article Information

Last Updated:2019-02-05 01:31:43
Published:2019-02-05