Skip to content

Instantly share code, notes, and snippets.

@ovarn
ovarn / glide.json
Created August 27, 2025 18:21 — forked from chaorace/glide.json
Yokohama Whitelisted Global Java APIs JSON
This file has been truncated, but you can view the full file.
[
{
"class": "AjaxResourceSchedule",
"method": "constructor",
"parameters": [],
"return": "AjaxResourceSchedule",
"static": false
},
{
"class": "AjaxResourceSchedule",
@ovarn
ovarn / ServiceNow Java Classes & Methods
Created February 16, 2025 14:07 — forked from chaorace/ServiceNow Java Classes & Methods
ServiceNow Tokyo Whitelisted Packages
This is a list of all Java classes that are whitelisted for use in global ServiceNow background scripting as of the Tokyo release
Everything is derived from log output of GlideWhiteListManager.get().logMemberWhitelistEntries() and GlideWhiteListManager.get().logClassWhitelistEntries()
Many, but NOT ALL of these should be accessible via the global "Packages" object.
- e.g. The Java string class (java.lang.String) can be accessed as: Packages.java.lang.String
FYI: ServiceNow has deprecated directly accessing Java classes in this way and will REFUSE to support customer code that does this
NOTE: java.* classes will generally be aligned with JDK 8 and are fully documented in the public JavaDocs
- https://docs.oracle.com/javase/8/docs/api/index.html
@ovarn
ovarn / servicenow_date_field_typecasting.js
Created August 5, 2022 11:23
A cheat sheet for working with the ServiceNow Date and Date/Time fields on the client side.
// Display value
var dateStr = g_form.getValue('<date_field_name>');
// Display value => milliseconds
var ms = getDateFromFormat(dateStr, g_user_date_format);
// Milliseconds => JS Date instance
var date = new Date(ms);
// JS Date instance => display value
@ovarn
ovarn / Show Today Emails Logs.xml
Created August 4, 2022 09:57
The UI Action simplifies the debugging of ServiceNow notifications by redirecting you from the notification definition to the email log list view with the predefined filter.
<?xml version="1.0" encoding="UTF-8"?>
<unload unload_date="2022-08-04 09:45:12">
<sys_ui_action action="INSERT_OR_UPDATE">
<action_name/>
<active>true</active>
<client>true</client>
<client_script_v2><![CDATA[function onClick(g_form) {
}]]></client_script_v2>
<comments/>
@ovarn
ovarn / cat_item_with_all_variables.js
Last active July 7, 2022 19:58
The snippet creates a catalog item with all possible variables types and orders the created item with dummy data.
var varObj = {
1: { name: 'YES_NO', value: 'No' },
2: { name: 'MULTI_LINE_TEXT', value: '1\n2' },
3: { name: 'MULTIPLE_CHOICE', value: 'second' },
4: { name: 'NUMERIC_SCALE', value: '2' }, // 0 - 5 by default
5: { name: 'SELECT_BOX', value: 'software' }, // Incident category
6: { name: 'SINGLE_LINE_TEXT', value: 'Dummy text' },
7: { name: 'CHECKBOX', value: true },
8: { name: 'REFERENCE', value: '57af7aec73d423002728660c4cf6a71c' }, // OOTB incident
9: { name: 'DATE', value: '2022-01-07' },