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
// run in background here: now/nav/ui/classic/params/target/sys.scripts.do | |
// started from: https://www.servicenow.com/community/developer-forum/use-script-to-export-records-to-xml/m-p/2571773 | |
// all credit to Riya Verma: https://www.servicenow.com/community/user/viewprofilepage/user-id/199367 | |
// This will NOT get any attachments for the record. | |
// Define the tables you want to export records from | |
//var tablesToExport = ['cmdb_application_product_model','scrum_theme','rm_epic','rm_story','rm_scrum_task']; | |
var tablesToExport = ['cmdb_application_product_model','scrum_theme','rm_epic','rm_story']; | |
// var tablesToExport = ['rm_epic']; // test with one table |
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="2024-02-16 00:10:43"> | |
<sysevent_in_email_action action="INSERT_OR_UPDATE"> | |
<action>record_action</action> | |
<active>true</active> | |
<assignment_operator/> | |
<condition_script/> | |
<description/> | |
<event_name>email.read</event_name> | |
<filter_condition table="sys_email">subjectSTARTSWITHNEWSTRY|^EQ<item goto="false" or="false" field="subject" endquery="false" value="NEWSTRY|" operator="STARTSWITH" newquery="false"/> |
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="2024-02-02 19:57:18"> | |
<sys_script action="INSERT_OR_UPDATE"> | |
<abort_action>false</abort_action> | |
<access>package_private</access> | |
<action_delete>false</action_delete> | |
<action_insert>true</action_insert> | |
<action_query>false</action_query> | |
<action_update>true</action_update> | |
<active>true</active> |
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="2024-01-26 17:59:29"> | |
<sys_ux_style action="INSERT_OR_UPDATE"> | |
<name>Camo</name> | |
<style>{ | |
"isCamo": "true", | |
"base": { | |
"--now-color--neutral": "48, 80, 54", | |
"--now-color--primary": "48, 80, 54", | |
"--now-color--secondary": "48, 80, 54", |
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
/* | |
https://www.servicenow.com/community/developer-articles/migrate-data-from-one-instance-to-another/ta-p/2303331 | |
Migrate Data from one instance to another | |
https://www.linkedin.com/in/raymond-estevao-31722619/ | |
Raymond Estevao | |
*/ | |
var ThrottleLimit = 50; //2 sec |
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","instancename"); | |
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
//Reference Qualifier Script to ensure users can only agents asscoaited with their own company | |
//SysID for Yoru Company : lfdkjslkajfsdlkajldkjalkdsjlkjadsljk | |
//If users matches your compamy then allow all agents | |
function GetICBCAgentsForCompany(company) { | |
var answer = ' '; | |
if (company != 'lfdkjslkajfsdlkajldkjalkdsjlkjadsljk'){ | |
var agent = new GlideRecord('u_icbc_agent'); | |
agent.addQuery('u_company',company); | |
agent.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); |
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 | |
DEFINE("USER","USERNAME"); | |
DEFINE("PASS","PASSWORD"); | |
DEFINE("INSTANCE","INSTANCE"); | |
//$URL = 'https://jira.URL.com/jira/rest/api/2/issue/createmeta'; | |
$URL = 'https://jira.URL.com/jira/rest/api/2/issue/'; | |
/* | |
$query=urlencode($query); |
NewerOlder