URL | Purpose |
---|---|
/stats.do | Quick stats |
/cache.do | Clear your instance cache |
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 example uses the Python Requests Library and you will need to install requests package for python | |
# Documentation can be found at http://docs.python-requests.org/en/master/user/quickstart/ | |
import requests | |
import pprint | |
import json | |
# Specify the Endpoint URL replacing {servicenow_instance_name} with your ServiceNow Instance Name | |
url = 'https://{servicenow_instance_name}.service-now.com/api/now/attachment/upload' |
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
// Callback functions | |
//built-in callback functions | |
//setTimeout, Arr.forEach, geolocation.getCurrentPosition | |
//make your own callback functions | |
//setTimeout( hello, 2000, 'Bob') | |
let names = ['Inga','Tom','Mattias','Carlos']; | |
names.forEach(hello); |
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
$sncusername = "MisterMistersBusiness" | |
$sncpassword = ConvertTo-SecureString "BLAHBLAHBLAH" -AsPlainText -Force | |
$snccredentials = New-Object System.Management.Automation.PSCredential ($sncusername, $sncpassword) | |
$StartDate = ((Get-Date).Year).ToString() + "-" + ((Get-Date).Month).ToString() + "-" + ((Get-Date).AddDays(-01).Day).ToString() | |
$EndDate = ((Get-Date).Year).ToString() + "-" + ((Get-Date).Month).ToString() + "-" + ((Get-Date).Day).ToString() | |
$Results = (Invoke-RestMethod -Method Get -Uri "https://central1.service-now.com/api/now/table/sys_audit?sysparm_query=user=snc_discovery_user^fieldname!=DELETED^sys_created_on>javascript:gs.dateGenerate('$StartDate','23:00:00')^sys_created_on<javascript:gs.dateGenerate('$EndDate','01:00:00')" -Credential $snccredentials).Result | |
$ComputerIDs = $Results | Select documentkey -Unique | |
Foreach ($Record in $Results) { |
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
<?php | |
date_default_timezone_set('America/Los_Angeles'); | |
DEFINE("INSTANCE","central1"); | |
DEFINE("SITE", "http://".$_SERVER['SERVER_NAME']); // ENABLE THIS LINE WHEN PUSHED TO PROD | |
DEFINE("USER","username"); | |
DEFINE("PASS","password"); | |
function getXML($table,$query) { |
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
/* | |
The following business rules have been disabled to prevent worknotes from checklist/item changes | |
https://central1.service-now.com/sys_script_list.do?sysparm_query=GOTOnameLIKECRUD | |
*/ | |
// Get the template data with the checklist items | |
var gr = new GlideRecord('checklist_template'); | |
gr.get('dcc0b5e6373fa200afb4d02783990ef5'); // TEST TEMPLATE | |
var json = JSON.parse(gr.template); |
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 tableName = 'sc_req_item'; | |
var sysIDOfRecord = current.sys_id; | |
//Declare a new instance of GlideSysAttachment. | |
var gsa = new GlideSysAttachment(); | |
//Get the raw bytes in the file | |
var bytesInFile = gsa.getBytes(tableName, sysIDOfRecord); | |
//Convert that jive into a string using Java/Rhino. | |
var dataAsString = Packages.java.lang.String(bytesInFile); | |
//Re-convert to a string in Javascript, cause we don't trust Rhino. | |
csv = String(dataAsString); |