Use case:

A user assigned to a problem can choose to defer the fix for the problem. In ServiceNow, each problem can have many incidents. Therefore, a user can request a policy exception for the incident with respect to the problem. This enables a user to request policy exception from the Problem form whereas the actual record for which the policy exception must be created is Incident.

Register an application and table with GRC in integration registry

    1. Navigate to Policy and Compliance -> Policy Exceptions -> Integration Registry.
    2. Enter the information in the required fields such as Name and Policy exception target table in the primary section.
    3. In the Entity Mapping section, select the relationship from one of the following options:
      • Reference field: If the field is directly available in the policy exception target table.
      • Related list:  If the field is available in a table and that table is related to the policy exception target table.
    4. In the Request source section, perform the following steps. This is optional section.
      1.   Select the table from which you want to request policy exception.
      2.  Select the relationship as Reference field if Request source table and policy exception target table are directly related.
      3. Select the relationship as related field if Request source table and policy exception target table are related with the Mapping table.

Restricted caller access privilege: Please provide Restricted caller access privilege for all required tables from Script Include: PolicyExceptionBase and source scope GRC: Policy and Compliance Management.



See the following example of Problem incident registration:

  1. Problem – Request source table.
  2. Incident – Policy exception target table.
  3. Entity Mapping section - Configuration item field in the incident is entity and related with reference field.
  4. Request source section – Incident has a Problem field which maps to the Request source table.


Create a UI action “Request policy exception”

  1. Mark UI action as client callable.
  2. Select the Show on update check box.
  3. Select the Form button check box.  
  4. In Onclick text field write popupDispList() function call.
  5. Apply any condition on conditions box as per your requirements.
    7. Enter the following code for UI action. The argument for createPolicyException function varies based on the integration.

    function popupDispList(){

                ScriptLoader.getScripts(['sn_compliance.PolicyExceptionUtils.jsdbx'], function() {





View the list of policy exception target records on policy exception form

  1. Create a new view for your application.
  2. Navigate to System Definition -> Relationships -> New.
  3. In the Applies to table field select Policy exception from the drop-down list.
        Queries from the table are either Policy exception target table or Request source mapping table if the relationship type is Related list in the request source section.
  4. For sn_compliance.PolicyException().refineQuery function the second argument is the policy exception target table name.
  5. Add this related list to your view defined in step 1.
  6. (function refineQuery(current, parent) {

        new sn_compliance.PolicyException().refineQuery(current,parent,'incident');

    })(current, parent);


Track policy exception from Request source table

  1. Create a relationship.
  2. Navigate to System Definition -> Relationships -> New.
  3. Applies to table is the request source table.
  4. In the Queries from table field, select Policy exception from the drop-down list.
  5. (function refineQuery(current, parent) {

        current.addQuery('source_record', parent.getUniqueValue());

    })(current, parent);


Article Information

Last Updated:2020-03-09 02:12:06