Evidence Request ConfigurationUse Case: Evidence request is used by audit and compliance teams for requesting supporting documents during an audit. Audit and compliance teams require these documents from the first line of defence. Evidence is all the information used by an auditor in determining the audit opinion. Evidence includes the information contained in the accounting records underlying the financial statements and other information. Evidence is cumulative in nature. It includes evidence obtained from the audit procedures performed during the audit. Evidence may also include audit evidence obtained from other sources, such as previous audits, a firm's quality control procedures for client acceptance, and continuance. The evidence requests can be raised on the records like Policy, Control, Control Objective, Authority Document, Citation, Issues, Engagement, Control Test, Audit Task and Entity. ServiceNow provides a related list called ‘Related Evidence’ on the forms mentioned previously. However, this related list, by default, is not displayed on the forms. Users can add this related list to the form if they need additional information of finding any evidence request tasks that are indirectly related to this table. For example, on the control objective form, the Related Evidence related list displays the evidence requests tasks that were created on the controls that are mapped to this control objective. Following is the list of all the mappings that are considered for displaying the Related Evidence for each of the tables: Table Name Related Evidence Control Evidence request tasks created on the control test mapped to the control, and issues created for the control. Control Test Evidence request tasks created on the controls associated with the control test. Entity Evidence request tasks created on the controls associated with the entity and tasks created on the issues mapped to the entity. Control Objective Evidence request tasks created on the controls associated with the control objective. Citation Evidence request tasks created on the control objective associated with the citation. Authority Document Evidence request tasks created on the citations mapped to this authority document. Policy Evidence request tasks created on the control objective associated with the policy. Engagement Evidence request tasks created on the entities, controls, control tests, audit tasks, control test issues, and issues mapped to the engagement are displayed. Additional Related Evidence records configuration To display the records in the related evidence, the relationships 'Related Evidence' are created accordingly for all the above-mentioned tables. If you want to populate the related evidence considering other tables apart from the configured ones, you must update the script. If the relationship between the applies to the table and the table (on which the evidence request tasks are created) is mapped through an M2M table, you must configure the related list in the following way: Navigate to System Definition > Relationships. Search for‘Related Evidence’ and applies to field must be the table on which you want to configure additional records for evidence record.The 'Applies to table' denotes that this related list will be available on the table form configured.The 'Queries from table' denotes the related list entries, that is, Evidence request tasks.On the control objective form, in the related evidence related list, you can see the evidence request tasks that are created on the controls associated to the control objective, and if you want to also display the evidence request tasks that are created on a policy which is mapped to the control objective, you must add the following script.Join the M2M table with the evidence request task table, by evidence for and the column reference (table records) which you want to display in the related list. In this case, you must join the document (policies) with 'evidence_for' field to get the evidence request tasks that are created on policies and having mapped to this control objective.The sys id of all the query results must be pushed to the existing array evidence to display on the related list. var evidenceRecord = new GlideRecord("sn_grc_advanced_evidence_response"); var policiesRecord = evidenceRecord.addJoinQuery("sn_compliance_m2m_policy_policy_statement", "evidence_for", "document"); policiesRecord.addCondition("content", parent.getUniqueValue()); evidenceRecord.addQuery("table_name", "sn_compliance_policy"); evidenceRecord.query(); while (evidenceRecord.next()) { evidences.push(evidenceRecord.getUniqueValue()); } If the relationship between the applies to the table and the table (on which the evidence request tasks are created) has a direct reference table to the applies to the table, you must configure the related list in the following way: Navigate to System Definition > Relationships. Search for 'Related Evidence' and applies to must be the table on which you want to configure additional records for evidence record.The 'Applies to table' denotes that this related list will be available on the table form configured.The 'Queries from table' denotes the related list entries, i.e., Evidence request tasks.On the control objective form, in the related evidence related list, you can view the evidence request tasks that are created on the controls associated to the control objective and if you want to also display the evidence request tasks that are created on an issue which are created on the control objective, you must add the following script.Join the record table (sn_grc_issue in this use case) with the evidence request task table, by evidence for and the sys_id. Get the evidence request tasks that are created on issues and are mapped to this control objective.The sys id of all the query results is to be pushed to existing array evidence to display on the related list. var evidenceRecord = new GlideRecord("sn_grc_advanced_evidence_response"); var issueRecord = evidenceRecord.addJoinQuery("sn_grc_issue", "evidence_for", "sys_id"); issueRecord.addCondition("content", parent.getUniqueValue()); evidenceRecord.addQuery("table_name", "sn_grc_issue"); evidenceRecord.query(); while (evidenceRecord.next()) { evidences.push(evidenceRecord.getUniqueValue()); } Request Evidence List UI Action configuration Evidence requests can be created on multiple records at once from the related lists. This is already configured on the engagement form where evidence requests can be created from the related lists of entities, audit tasks, issues using a List UI Action. This List UI Action can be configured on the below listed related lists table entries on any form. Tables for ‘Compliance’ type: ControlControl testEntityPolicyCitationControl objectiveAuthority document and Issue Tables for ‘Audit’ type: ControlControl testAudit taskEngagementEntityControl objectiveIssues Steps to configure the List UI Action: Create a UI Action named as 'Request Evidence'.Select the Show on insert check box.Select the Show on update check box.Select the Form button check box. Select the List choice check box.Select the Client checkboxIn the Onclick text field, mention a function name like createEvidenceForIssue (based on the table you requested). Make sure the function name added should be same as that of the function used in the script.Apply any condition on the conditions box according to your requirements.Enter the following code for the UI action. function createEvidenceForIssue() { var dialog = new GlideModal('sn_grc_advanced_request_evidence'); dialog.setTitle('Request Evidence'); dialog.setPreference('sysparm_sys_id_list', g_list.getChecked()); dialog.setPreference('sysparm_type', "audit"); // Configure the 'type' argument as audit or compliance based on the table you are requesting. If the table falls in the both types, skip this line. dialog.setPreference('caller_table', "sn_grc_issue"); // The table name which you are requesting evidence for. Here in this case, as you are requesting for issue, it is configured as 'sn_grc_issue' dialog.on('closeconfirm', refreshPage); dialog.render();} function refreshPage() { return true;}