Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • Madrid
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

Script methods

Log in to subscribe to topics and get notified when content changes.

Script methods

ServiceNow provides four methods for creating the audit script.

Table 1. Script methods
Name Description Parameters
getFilterRecords public GlideRecord getFilterRecords(String filterId) filterID: The sys_id of the filter to use.
logAuditResultPass public void logAuditResultPass(String auditId, String auditedRecordId, boolean isCI, String domainToUse)

auditId: Sys_id of audit record executed

auditedRecordId: Sys_id of the record audited.

isCI: True, if the audited record is a CI, false if otherwise.

domainToUse: Sys_domain of the cert_audit record.

logAuditResultFail public void logAuditResultFail(String auditId, String auditedRecordId, String followOnTask, String columnDisplayName, String operatorLabel, String desiredValue, String discrepancyValue, boolean isCI, String domainToUse)

auditId: Sys_id of audit record executed.

auditedRecordId: Sys_id of the record audited.

followOnTask: Sys_id of the follow-on task associated with the audited record. This can be an empty string.

columnDisplayName: Label of the column audited. For example, Disk space (GB).

operatorLabel: Label of the operator used to audit the column. For example, is not empty or greater than.

desiredValue: Desired value of the column.

discrepancyValue: Discrepancy value.

isCI: True, if the audited record is a CI, false if otherwise.

domainToUse: Sys_domain of the cert_audit record.

createFollowOnTask() public String createFollowOnTask(String auditId, String ciId, String assignedTo, String assignmentGroup, String shortDescr)

auditId: Sys_id of the audit record executed.

ciId: Sys_id of the configuration item. This is an empty string if the table is not extended from the cmdb_ci table.

assignedTo: Sys_id of the task's assigned user. This can be an empty string.

assignmentGroup: Sys_id of the group the task is assigned to. This can be an empty string.

shortDescr: The text to use for the short description of the follow-on task.

Feedback