{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":47014,"path":"servicenow-platform/configuration-management-database-cmdb/r_ScriptMethods.md","title":"Script methods","bundle":null,"doc_type":null,"release":"australia","body":"\n# Script methods\n\nServiceNow provides four methods for creating the audit script.\n\n<table id=\"table_h1y_st3_5q\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th><th>\n\nParameters\n\n</th></tr></thead><tbody><tr><td>\n\ngetFilterRecords\n\n</td><td>\n\npublic GlideRecord getFilterRecords\\(String filterId\\)\n\n</td><td>\n\nfilterID: The sys\\_id of the filter to use.\n\n</td></tr><tr><td>\n\nlogAuditResultPass\n\n</td><td>\n\npublic void logAuditResultPass\\(String auditId, String auditedRecordId, boolean isCI, String domainToUse\\)\n\n</td><td>\n\nauditId: Sys\\_id of audit record executed\n\n auditedRecordId: Sys\\_id of the record audited.\n\n isCI: True, if the audited record is a CI, false if otherwise.\n\n domainToUse: Sys\\_domain of the cert\\_audit record.\n\n</td></tr><tr><td>\n\nlogAuditResultFail\n\n</td><td>\n\npublic void logAuditResultFail\\(String auditId, String auditedRecordId, String followOnTask, String columnDisplayName, String operatorLabel, String desiredValue, String discrepancyValue, boolean isCI, String domainToUse\\)\n\n</td><td>\n\nauditId: Sys\\_id of audit record executed.\n\n auditedRecordId: Sys\\_id of the record audited.\n\n followOnTask: Sys\\_id of the follow-on task associated with the audited record and can be an empty string.\n\n columnDisplayName: Label of the column audited. For example, Disk space \\(GB\\).\n\n operatorLabel: Label of the operator used to audit the column. For example, is not empty or greater than can be the label.\n\n desiredValue: Desired value of the column.\n\n discrepancyValue: Discrepancy value.\n\n isCI: True, if the audited record is a CI, false if otherwise.\n\n domainToUse: Sys\\_domain of the cert\\_audit record.\n\n</td></tr><tr><td>\n\ncreateFollowOnTask\\(\\)\n\n</td><td>\n\npublic String createFollowOnTask\\(String auditId, String ciId, String assignedTo, String assignmentGroup, String shortDescr\\)\n\n</td><td>\n\nauditId: Sys\\_id of the audit record executed.\n\n ciId: Sys\\_id of the configuration item. This string is empty when the table is not extended from the cmdb\\_ci table.\n\n assignedTo: Sys\\_id of the assigned user of the task. This string can be empty.\n\n assignmentGroup: Sys\\_id of the group the task is assigned to. This string can be empty.\n\n shortDescr: The text to use for the short description of the follow-on task.\n\n</td></tr></tbody>\n</table>"}}