This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Validates that a change request's CI is a valid type based on change type | |
* @type {Class} | |
*/ | |
var ChangeCIValidation = Class.create(); | |
ChangeCIValidation.prototype = Object.extendsObject(AbstractAjaxProcessor, { | |
/** | |
* @description Validates that a CI is the appropriate class | |
* @param {String} ci The sys_id of a CI | |
* @param {String} type A change type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ct = new ChangeTasker(current), | |
cm = new ChangeManagementUtil(); | |
if (current.isNewRecord()) { | |
ct.run(); | |
} | |
if (ct.dateFieldChanges(current)) { | |
ct.updateDueDatesOnTasks(); | |
} | |
if (current.approval.changesTo("approved")) { | |
ct.runOnApproval(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ct = new ChangeTasker(current), | |
cm = new ChangeManagementUtil(); | |
if (ct.isNonInfrastructureCreated()) { | |
ct.runOnNewChange(); | |
} | |
if (ct.isInfrastructureScheduled(current.type, current.u_life_cycle_status.changesTo("Scheduled"))) { | |
ct.runOnScheduled(); | |
} | |
if (current.cmdb_ci.changes()) { | |
ct.runOnUpdate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Allows users to copy a requested item on the form | |
* @extends {AbstractAjaxProcessor} | |
* @type {Class} | |
*/ | |
var CopyARequest = Class.create(); | |
CopyARequest.prototype = Object.extendsObject(AbstractAjaxProcessor, { | |
/** | |
* @description ServiceNow's ArrayUtil | |
* @type {ArrayUtil} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Looks at other approvals to determine if one needs to be generated | |
* @type {Class} | |
*/ | |
var ApproveAhead = Class.create(); | |
ApproveAhead.prototype = { | |
/** | |
* @description The name of the approval table | |
* @type {String} | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Reverses an encoded query to provide the oppposite of what it would normally provide | |
* @namespace | |
* @type {Class} | |
*/ | |
var EncodedQueryReversal = Class.create(); | |
EncodedQueryReversal.prototype = { | |
/** | |
* @description Contains objects of conditions and what to replace them with | |
* @type {Array} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Determines what event to use when the approval state changes on a task record | |
* @namespace | |
* @type {Class} | |
*/ | |
var ApprovalEventsHandler = Class.create(); | |
ApprovalEventsHandler.prototype = { | |
/** | |
* @description Cancelled state value | |
* @type {String} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Searches for email notifications based on certain criteria | |
* @namespace | |
* @type {Class} | |
*/ | |
var NotificationsTester = Class.create(); | |
NotificationsTester.prototype = { | |
/** | |
* @description The name of the email table | |
* @type {String} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Allows unit testing of Events | |
* @namespace | |
* @example | |
* //Create an incident, update the state, then ensure the incident.state.changed event was fired | |
* var incident = new GlideRecord('incident'); | |
* if (incident.get(sys_id)) { | |
* incident.state = 2; | |
* incident.update(); | |
* } |
NewerOlder