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
| <mail_script> | |
| var ritm = new GlideRecord('sc_req_item'); | |
| ritm.addQuery("sys_id", current.request_item); | |
| ritm.query('cat_item.name', 'Standard Laptop'); | |
| ritm.query(); | |
| if (ritm.next()) { | |
| photoshop = ritm.variables.photoshop; | |
| email.setSubject("New Laptop requested and photoshop is set to " + photoshop + " " + current.number); | |
| } | |
| </mail_script> |
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 | |
| To silently install the ServiceNow MID Server on a Windows system. | |
| Place the file on the target MID Server host machine, update the variables at the top | |
| and run it in PowerShell. | |
| #> | |
| $MSI_FILE_NAME = "C:\temp\winmid.msi" | |
| $INSTALL_LOCATION = "C:\winmid" | |
| $INSTANCE_URL = "https://dev1234.service-now.com/" |
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 target = new GlideRecord('sys_email'); | |
| target.initialize(); | |
| target.type = 'received'; | |
| target.subject = "Test Email Subject"; | |
| target.recipients = "itdept@domain.com"; | |
| target.origemail = "bob.smith@domain.com"; | |
| target.body = "sample email body for description"; | |
| target.body_text = "sample email body for description"; | |
| target.headers = "From:Bob Smith <bob.smith@domain.com> \ | |
| To:itdept@domain.com \ |
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 checkIfRecordExists(payloadItem) { | |
| var certGr = new GlideRecord('cmdb_ci_certificate'); | |
| certGr.addQuery('fingerprint', payloadItem.values['fingerprint']); | |
| certGr.query(); | |
| return certGr.next() ? certGr : ""; | |
| } | |
| var rtrn = {}; | |
| //parsing the json string to a json object |
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
| /* | |
| MID SERVER WILL NEED TO TRUST YOUR CERTIFICATE OR YOU CAN UPDATE MID CERTIFICATE POLICY FOR Intranet | |
| https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0864769 | |
| */ | |
| var username = 'admin'; | |
| var pwd = 'pass'; | |
| var nessusHost = 'secops.domain.home'; | |
| var scanName = 'My Scan for Lab'; | |
| var midserver = 'winmid01'; |
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
| import sys | |
| if len(sys.argv) < 4: | |
| warning = """ | |
| Please provide 3 parameters in the format "instancename username password" | |
| e.g. dev1234 itiluser itiluserpassword | |
| """ | |
| print(warning) | |
| sys.exit() | |
| sninstance = "https://" + sys.argv[1] + ".service-now.com" |
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
| import sys | |
| if len(sys.argv) < 4: | |
| warning = """ | |
| Please provide 3 parameters in the format "instancename username password" | |
| e.g. dev1234 itiluser itiluserpassword | |
| """ | |
| print(warning) | |
| sys.exit() | |
| sninstance = "https://" + sys.argv[1] + ".service-now.com" |
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
| //for use with ServiceNow UI Action client script to create a new Incident from a CI | |
| function loadModal() { | |
| var fieldquery = ''; | |
| var fields = [ | |
| 'cmdb_ci=' + g_form.getUniqueValue(), | |
| 'caller_id=' + g_user.userID, | |
| 'contact_type=' + 'self-service', | |
| 'short_description=' + 'Incident for ' + g_form.getValue('name'), | |
| ]; | |
| fields.forEach(function(field) { |
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
| /* | |
| A background script to run a command and test MID Server connectivity to an endpoint. | |
| Just set the value to your midserver name. | |
| */ | |
| //capture start time | |
| var now = (new GlideDateTime()); | |
| var probe = SncProbe.get("Windows - Powershell"); | |
| var midServer = 'winmid06'; | |
| var psCommand = 'test-netconnection -port 443 192.168.1.1'; |
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 showModal() { | |
| // get current values from description | |
| var currentOutageDetails = g_form.getValue('description'); | |
| var securityStatus = getCurrentValueSingle(currentOutageDetails, 'Potential Security Issue:'); | |
| var businessStatus = getCurrentValueSingle(currentOutageDetails, 'Business Operation Affected:'); | |
| var symptomStatus = getCurrentValueSingle(currentOutageDetails, 'Reported Symptoms:'); | |
| var descStatus = getCurrentValueMulti(currentOutageDetails, 'General Description:'); | |
| var gm = new GlideModal('Set Description'); | |
| gm.setTitle('Set Description'); |