This file contains hidden or 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
| /** | |
| * Show an animated loading message such as "Loading...", where the dots will be | |
| * animated with the interval specified in msInterval; first showing "Loading.", then | |
| * "Loading..", then "Loading...", up to the number of dots indicated in maxDots. | |
| * Once maxDots is reached, the message will be reset to "Loading." and the animation | |
| * will repeat until stopAnimatedLoadingMessage() is called. | |
| * | |
| * @param {String} fieldName - The name of the field on which to show the loading message. | |
| * @param {String} messageText - The loading message to be shown, which will be followed | |
| * by animated dots (or whatever character is specified in dotChar, if specified). |
This file contains hidden or 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
| // GM_download | |
| function Download(url, name, opt={}) { | |
| Object.assign(opt, { url, name }) | |
| return new Promise((resolve, reject) => { | |
| opt.onerror = reject | |
| opt.onload = resolve | |
| GM_download(opt) | |
| }) |
This file contains hidden or 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
| /* | |
| * ajax Defaults (optional): | |
| $.ajaxSetup({ | |
| type : 'POST', | |
| dataType : 'json', | |
| cache : true, | |
| global : true, | |
| data : {}, | |
| contentType : 'application/json', | |
| beforeSend : function (xhr) { |
This file contains hidden or 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 OAuthGitHubHandler = Class.create(); | |
| OAuthGitHubHandler.prototype = Object.extendsObject(OAuthUtil, { | |
| // Override postprocessAccessToken method. GitHub returns a urlencoded | |
| // body, so we need to break this apart and extract the values. | |
| postprocessAccessToken: function(accessTokenResponse) { | |
| var contentType = accessTokenResponse.getContentType(); | |
| var contentBody = accessTokenResponse.getBody(); | |
| var paramMap = accessTokenResponse.getparameters(); | |
| var params = contentBody.split('&'); | |
| var parts; |
This file contains hidden or 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 OAuthBitlyHandler = Class.create(); | |
| OAuthBitlyHandler.prototype = Object.extendsObject(OAuthUtil, { | |
| initialize: function() { | |
| }, | |
| interceptRequestParameters : function(requestParamMap) { | |
| // Add/Modify request parameters if needed | |
| this.preprocessAccessToken(requestParamMap); | |
| }, | |
This file contains hidden or 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
| // This is where we'll save the attachment | |
| var tablename = 'incident'; | |
| var recordSysId = '8d6353eac0a8016400d8a125ca14fc1f'; | |
| var filename = 'snlogo.png'; | |
| // Let's download the ServiceNow Logo | |
| var logoUrl = 'https://instance.service-now.com/images/logos/logo_service-now.png'; | |
| var request = new sn_ws.RESTMessageV2(); | |
| request.setHttpMethod('get'); | |
| request.setEndpoint(logoUrl); |
This file contains hidden or 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 hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <unload unload_date="2015-01-30 16:06:32"> | |
| <sys_remote_update_set action="INSERT_OR_UPDATE"> | |
| <collisions/> | |
| <commit_date/> | |
| <deleted/> | |
| <description>PagerDuty is a third-party system used to alerts individuals/teams when an important issue requires attention. The integration with ServiceNow focuses on finding an owner (assignee) for high priority incidents. | |
| Integration is supported in both directions allowing incidents to be acknowledged, delegated (assigned to another group) and resolved in either system. The following work models are supported: | |
| 1. User uses PagerDuty for notification only. Once notified, he/she uses ServiceNow to assign, investigate, resolve the incident. |
This file contains hidden or 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 waitForEl = function(selector, callback) { | |
| if (jQuery(selector).length) { | |
| callback(); | |
| } else { | |
| setTimeout(function() { | |
| waitForEl(selector, callback); | |
| }, 100); | |
| } | |
| }; |