This repo serves as my personal archive of slashcommand that I can't live without since I'm often switching client remote desktops and laptops and wanted a easy place to go to import them all at once. There is a slashcommands.json file that you can use to import the commands in bulk, and I've written a quick GitHub action to list them out one by one below so they can be grabbed a la cart.
Special slashcommand, accessible via extension keyboard shortcut
My preferred keyboard bound slashcommand is the //tab command which just opens a fresh tab. I bind this to ⌥T.
//tabWidgets <search>
Search for widgets by name or id.
sp_widget_list.do?sysparm_query=nameLIKE$0^ORidLIKE$0^ORDERBYDESCsys_updated_onStats.do
Open the stats.do page, kinda silly since you can do /stats.do but I like it.
/stats.doGroups <search>
Search for groups by name or get to the group table quickly.
sys_user_group_list.do?sysparm_query=nameCONTAINS$0^ORDERBYDESCsys_updated_onMy Companies Applications
Open the My Companies Applications page, useful for installing or updating internal apps.
/$mycompanyappsmgmt.doLoad an update set
Opens the load update set page.
upload.do?sysparm_referring_url=sys_remote_update_set_list.do%3Fsysparm_fixed_query%3Dsys_class_name%3Dsys_remote_update_set&sysparm_target=sys_remote_update_setAgile Board
Opens the Agile Board, about as good as a bookmark, but in a slashcommand.
/$agile_board.do#/sprint_planningSLA Definitions <search>
Search for SLA definitions by name, or get to the SLA table quickly.
contract_sla_list.do?sysparm_query=nameLIKE$0^ORDERBYDESCnameRoles <search>
Search for roles by name, or get to the role table quickly.
sys_user_role_list.do?sysparm_query=nameLIKE$0^ORDERBYnameClear Cache
Opens the cache.do page, useful for clearing the cache. Use it in conjunction with the /cls command.
cache.doData Broker Server Scripts <search>
Search for Data Broker Server Scripts by name, or get to the Data Broker Server Script table quickly.
sys_ux_data_broker_transform_list.do?sysparm_query=nameLIKE$0^ORDERBYnameACL Roles Relation <search>
Search for ACL Roles Relation by the role name, useful to see which ACLs that a role is affiliated with.
sys_security_acl_role_list.do?sysparm_query=sys_user_role.nameLIKE$0^ORDERBYDESCsys_security_aclEvent Log <search>
Shows the event log for the day, useful for checking if events have been queued and processed.
sysevent_list.do?sysparm_query=sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^nameLIKE$0^ORDERBYDESCsys_created_onUX Add-on Event Mappings for Macroponent
Shows the UX Add-on Event Mappings for the macroponent, useful for checking if events have been mapped correctly or fixing broken mappings. Intended to be run on a macroponent record.
sys_ux_addon_event_mapping_list.do?sysparm_query=parent_macroponent=$sysidApp Log for Current Scope
Shows the app log for the current scope for the day, way less cluttered than the general instance log.
syslog_app_scope_list.do?sysparm_query=sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^sys_scope=javascript:gs.getPreference("apps.current_app")^ORDERBYDESCsys_created_onSyslog for today, only errors
Shows the syslog for the day, only showing errors and warnings.
syslog_list.do?sysparm_query=sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^levelIN2,3^ORDERBYDESCsys_created_onExample: Open in Test
Example slashcommand to open the the current record in the test environment. Double // invokes another command. Replace test with your instance prefix. (test.service-now.com)
//env testExample: Compare to record in Test
Example slashcommand to open compare the current record with the test environment. Double // invokes another command. Replace test with your instance prefix. (test.service-now.com)
//diffenv testNew update set
Opens a new update set record, for your current scope.
sys_update_set.do?sys_id=-1My recent updates
Shows the recent updates you have made, useful for checking your updates have been captured and in which update sets.
sys_update_xml_list.do?sysparm_query=sys_updated_by=javascript:gs.getUserName()^ORDERBYDESCsys_created_onView Node Logtail
Opens the logtail channel, useful for tailing the node logs. Can be useful in REST message processing debugging.
channel.do?sysparm_channel=logtailRole Contains Roles <search>
Search for roles that contain other roles, useful for checking role hierarchies.
sys_user_role_contains_list.do?sysparm_query=containsLIKE$0^ORDERBYnullCurrent Update Set
Opens the current update set, no longer do you need to go through the header.
sys_update_set.do?sys_id=javascript:gs.getPreference('sys_update_set')Enable NextExperience Logging
Enables logging in the NextExperience, useful for debugging. Does the same thing as the DEX extension.
javascript:window.nowUiFramework.setConfigItem("loggingEnabled",!0),window.nowUiFramework.setConfigItem("loggingLevels",["error","warn","info","debug","trace"]);Remote Instances <search>
Navigate to the remote instances list to retrieve update sets from lower environments.
sys_update_set_source_list.do?sysparm_query=^ORDERBYnameScheduled Jobs <search>
Search for scheduled jobs by name, or get to the scheduled job table quickly.
sysauto_list.do?sysparm_query=nameLIKE$0^ORDERBYnameEvent Registry <search>
Search for events by name, or get to the event registry table quickly.
sysevent_register_list.do?sysparm_query=event_nameLIKE$0^ORDERBYnullNotifications <search>
Search for notifications by name, or get to the notification table quickly.
sysevent_email_action_list.do?sysparm_query=nameLIKE$0^ORDERBYorderRunning Scheduled Jobs
Shows the scheduled jobs that are currently running, useful for checking on the completion of scheduled jobs.
sys_trigger_list.do?sysparm_query=next_actionONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^state=1^ORDERBYnameIndicators <search>
Search for PA Indicators by name, or get to the indicator table quickly.
pa_indicators_list.do?sysparm_query=type=1^nameLIKE$0^ORDERBYorderScripts <search>
Search for PA Scripts by name, or get to the script table quickly.
pa_scripts_list.do?sysparm_query=nameLIKE$0^ORDERBYnameScript Execution Histories <search>
Show the most recent script executions, useful for grabbing code you've previously run in background scripts or rolling back runs.
sys_script_execution_history_list.do?sysparm_query=^ORDERBYnullFix Scripts <search>
Search for fix scripts by name, or get to the fix script table quickly.
sys_script_fix_list.do?sysparm_query=nameLIKE$0^ORDERBYnameToday's History Set Captures
Shows the history set captures you have made today, useful grabbing historical values from records when they aren't in the activity formatter and you don't have admin/glide.history.role.
sys_history_line_list.do?sysparm_query=userDYNAMIC90d1921e5f510100a9ad2572f2b477fe^update_timeONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^ORDERBYnullForce current record to current update set
Opens the script editor with a script that will force the current record to your current update set. Needs to switched to global scope to be run, but will place the update in the current update set.
/sys.scripts.do?scope=global&content=var%20current%20%3D%20new%20GlideRecord%28%22$table%22%29%3B%0Aif%20%28current.get%28%22$sysid%22%29%29%7B%0A%20%20%20%20gs.info%28current.getDisplayValue%28%29%29%3B%0A%20%20%20%20var%20um%20%3D%20new%20GlideUpdateManager2%28%29%3B%0A%20%20%20%20um.saveRecord%28current%29%3B%0A%7DOpens the current record in CSM Workspace
Opens the current record in CSM workspace, super useful when you want to look at a record found using sys_id search or found in platform
/now/cwf/agent/record/$table/$sysid/params/selected-tab-index/0Opens the current record in AW Workspace
Opens the current record in AW Workspace, super useful when you want to look at a record found using sys_id search or found in platform
/now/workspace/agent/record/$table/$sysid/params/selected-tab-index/0Filters current table to only show records that have customer updates.
Uses a join query to filter the current table to only show records that have customer updates. I would love to make this a switch but the current implementation doesn't support it.
/$table_list.do?sysparm_query=^JOIN$table.sys_update_name=sys_update_version.name!source_table!=sys_store_appField Find <search>
Search for UI elements by name, useful for finding which views a field is on.
sys_ui_element_list.do?sysparm_query=elementSTARTSWITH$0^ORDERBYDESCelementUpdate Sets <search>
Search for update sets by name or get to the update set table quickly.
sys_update_set_list.do?sysparm_query=^ORDERBYDESCsys_created_onEmail Scripts <search>
Search for email scripts by name or get to the email script table quickly.
sys_script_email_list.do?sysparm_query=nameLIKE$0^ORDERBYnameDocument Template Scripts <search>
Search for document template scripts by name or get to the document template script table quickly.
sn_doc_template_script_list.do?sysparm_query=nameLIKE$0^ORDERBYnameUI Policy Actions <search>
Search for UI policy actions by field, really useful for checking what is showing/hiding a field.
sys_ui_policy_action_list.do?sysparm_query=fieldLIKE$0^ORDERBYfieldResume the most recent update set for record
Resumes the most recent update set for the current record. Will prompt you if you want to resume the update set if it is not in progress.
javascript: g_form?resumeUpdateSet(g_form.getTableName(),g_form.getUniqueValue()):snuSlashCommandInfoText("This command can only be used on a form view.",!1);
function resumeUpdateSet(c,b){c&&b?(snuSlashCommandShow("/resume",!1),fetch("/api/now/table/sys_update_version?"+new URLSearchParams({sysparm_query:`name=${`${c}_${b}`}^state=current^source_table=sys_update_set`,sysparm_fields:"source,source_table,source.state,source.name,source.sys_id,sys_id",sysparm_limit:1}),{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json","X-UserToken":g_ck}}).then(a=>a.json()).then(a=>{a.result[0]?a.result[0]&&"in progress"===a.result[0]["source.state"]?
snuSwitchUpdateSet(a.result[0]["source.sys_id"]):snuSlashCommandConfirm("The update set is not in progress. Do you want to resume it?",()=>{setUpdateSetToInProgress(a.result[0]["source.sys_id"])},()=>{snuSlashCommandInfoText("Update set not resumed.",!1)}):snuSlashCommandInfoText("No local update set found for current version of record.",!1)})):snuSlashCommandInfoText("Table and sys_id not found.",!1)}
function setUpdateSetToInProgress(c){fetch(`/api/now/table/sys_update_set/${c}`,{method:"PATCH",headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json;charset=UTF-8","X-UserToken":g_ck},body:JSON.stringify({state:"in progress"})}).then(b=>b.json()).then(b=>{b?.error?snuSlashCommandInfoText("Error setting update set to in progress:"+b.error.detail,!1):snuSwitchUpdateSet(c)}).catch(b=>{snuSlashCommandInfoText("Error setting update set to in progress:",b,!1)})}
function snuSlashCommandConfirm(c,b,a){window.top.document.getElementById("snudirectlinks").innerHTML=`
${c}
1 Yes
2 No
`;window.top.document.querySelectorAll("#snudirectlinks a").forEach(d=>{d.addEventListener("click",e=>{"snulnk1"===e.target.id?b():a()})})}
function snuSwitchUpdateSet(c){Object.keys(localStorage).filter(a=>a.includes(".available")).forEach(a=>{localStorage.removeItem(a)});let b={};b.sysId=c;c={Accept:"application/json, text/plain, */*","Content-Type":"application/json;charset=UTF-8","X-WantSessionNotificationMessages":!1};g_ck&&(c["X-UserToken"]=g_ck);fetch("/api/now/ui/concoursepicker/updateset",{method:"PUT",headers:c,body:JSON.stringify(b)}).then(a=>a.json()).then(a=>{a?.error?snuSlashCommandInfoText("Error switching:"+a.error.detail,
!1):(localStorage.setItem("snuPickerUpdated",(new Date).getTime()),snuSlashCommandInfoText("Reloading page...",!1),setTimeout(()=>{window.top.location.reload()},1600))}).catch(a=>{snuSlashCommandInfoText("Error switching:",a,!1)})};Script: resumeUpdateSet.js
Script Actions <search>
Search for script actions by event name, useful for finding what scripts are running on an event.
sysevent_script_action_list.do?sysparm_query=event_nameLIKE$0^ORDERBYorder^ORDERBYorderVisual Task Boards
Opens the Visual Task Boards page.
/$vtb.doForce the always show nav user preference.
Forces the always show nav user preference to be true. Useful for always showing the nav bar in the new UI. Script can be used to set any user preference.
javascript: (function(){function f(b){this.params={};this.addParam("sysparm_processor",b)}function g(b,a){return new Promise((c,d)=>{var e=new f("UserPreference");e.addParam("sysparm_type","set");e.addParam("sysparm_name",b);e.addParam("sysparm_value",a);e.getXML(function(h){200===h.status?c({name:b,value:a}):d(Error(`Failed to set preference: ${b}`))})})}var k={"glide.ui.polaris.ui16_tabs_inside_polaris":"true"};f.prototype.addParam=function(b,a){this.params[b]=a};f.prototype.getXML=function(b){var a=
new XMLHttpRequest;a.open("POST","xmlhttp.do",!0);a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");a.setRequestHeader("X-UserToken",window.g_ck);a.onload=function(){b(a)};var c=Object.keys(this.params).map(function(d){return encodeURIComponent(d)+"="+encodeURIComponent(this.params[d])},this).join("&");a.send(c)};"undefined"===typeof window.g_ck?snuSlashCommandInfoText("Security token not found. Make sure you're logged in to ServiceNow.",!1):async function(){for(const [b,a]of Object.entries(k))try{await g(b,
a),snuSlashCommandInfoText(`Preference set: ${b} = ${a}\n`,!0)}catch(c){snuSlashCommandInfoText(`Error setting preference ${b}: ${c.message}\n`,!0)}}()})();Script: forcePop.js