Skip to content

Instantly share code, notes, and snippets.

@mtcoffee
Last active February 8, 2026 16:25
Show Gist options
  • Select an option

  • Save mtcoffee/638c9b87077163878925d842310cd3a5 to your computer and use it in GitHub Desktop.

Select an option

Save mtcoffee/638c9b87077163878925d842310cd3a5 to your computer and use it in GitHub Desktop.
ServiceNow sys_navigator redirect Incident Platform UI to the SOW Workspace
// Check if the user has the 'itil' role but does not have the 'admin' role
if (gs.hasRole("itil") && !gs.hasRole("admin")) {
/**
* Set the redirect destination to the Service Operations Workspace (SOW).
* 1. ${current.getRecordClassName()} - Dynamically gets the table name (e.g., incident).
* 2. ${current.getUniqueValue() || "-1"} - Gets the record SysID, or uses -1 to open a 'New' form.
*/
answer = `/now/sow/record/${current.getRecordClassName()}/${current.getUniqueValue() || "-1"}`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment