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
| ///api/auclg/chris_test/get_incident/{id} | |
| (function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) { | |
| 2 | |
| | |
| 3 | |
| //INC0010808 | |
| 4 | |
| var uri = request.uri; | |
| 5 | |
| var url = request.url; |
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
| // /api/auclg/v1/chris_test/incident | |
| (function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) { | |
| //Creat Incident | |
| //Manadatory: Caller, Configuration Item, Assignment Group, Short Description | |
| //"Chris McDevitt, | |
| //ServiceNow How To, 006689dc6ff70900f71de82fae3ee4f5 | |
| //Service Desk, d625dccec0a8016700a222a0f7900d06 | |
| //What ever | |
| //caller_id, cmdb_ci, assignment_group, short_description |
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
| // api/auclg/v1/chris_test/incident/{number} | |
| (function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) { | |
| // implement resource here | |
| var caller; | |
| var configurationItem; | |
| var assignmentGroup; | |
| var shortDescription; | |
| var work_notes; |
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 bound to the global object in the browser | |
| // If strict is used then "this" is undefined | |
| //let myObject = this; //Of course you can look at any object | |
| //var myObject = this; | |
| var myObject = { one: "One", | |
| two: function(){return "Hello";}}; | |
| for(objExplore in myObject){ | |
| if(!objExplore.hasOwnProperty(objExplore)){ //note: "Don't searching Prototype Chain" | |
| console.log(objExplore + " " + typeof(myObject[objExplore]) ); |
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
| ga.getXML(parseResponse); | |
| // old (DOM Method) | |
| var result = response.responseXML.getElementsByTagName("result"); | |
| //New (JSON Parse Technique) | |
| //Use with Asynchronous GlideAjax calls with "getXMLAnswer" (not "getXML") | |
| var result = JSON.parse(answer); |
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
| ___________________________ | |
| Code snippett for part 1 | |
| ___________________________ | |
| task.cmdb_ci = current.cmdb_ci; | |
| task.short_description = 'Emergency change request for high security vulnerability : ' + current.vulnerability.id; | |
| task.work_notes = 'This Change record was created by the system for audit purposes. The Vulnerability Patch for ' + current.vulnerability.id + ' was installed automatically.'; | |
| ___________________________ | |
| Code snippet for part 2 |
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
| function onLoad() { | |
| var userID = g_form.getReference('caller',rb); | |
| } | |
| //if request is submitted by user X | |
| function rb(userID){ | |
| if (userID.user_name == "X" ){ | |
| g_form.setSectionDisplay("sometabname", true); | |
| } |
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
| current.u_ridac_type = "Issue"; | |
| current.u_product = "f46762b60fd61780b6422ca8b1050e79"; | |
| current.description = current.description + "\nLocation: " + producer.office_location; | |
| current.description = current.description + "\n\n************************************"; | |
| current.description = current.description + "\nPhone: " + producer.phone_issues_; | |
| current.description = current.description + "\nDesktop: " + producer.desktop_issues_; | |
| current.description = current.description + "\nPrinting : " + producer.printing_issues_; | |
| current.description = current.description + "\nInternet : " + producer.internet_issues_; | |
| current.description = current.description + "\nOne : " + producer.place_holder_one_; |
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
| (function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) { | |
| var caller; //Manadatory ServiceNow User | |
| var cmdb_ci; //Manadatory Varies need to provide list | |
| var shor_description; //Manadatory text 40 charters | |
| var company; //Manadatory "xxx | xxxx | xxx | xxxx" | |
| var requestBody = request.body; | |
| var requestData = requestBody.data; | |
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" ?> | |
| <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"> | |
| <g:evaluate> | |
| var testIds = RP.getWindowProperties().get('test_ids'); | |
| var testQuery = RP.getWindowProperties().get('test_query'); | |
| </g:evaluate> | |
| <div id="reassign_vulgroup_picker_container" > | |
| <div class="form-group"> |