Lukasz_Krzaczko
Giga Expert
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 07-16-2019 12:57 AM
Result:
1. When logged in, click SwissNow/Custom Scripts, paste sys_id to be found and press Enter:
2. Record with specific sys_id will be open
How to configure:
1. Install SwissNow: https://chrome.google.com/webstore/detail/swissnow-servicenow-toolb/jneeammdkdmlfgidcacmjmbijdmkdbjm
2. Click SwissNow/Custom Scripts
3. Click New script
4. Provide script name and required parameters (in this case - "sys_id"). Then click "Add" to add the parameter.
5. Paste following script:
var tables = new GlideRecord('sys_db_object');
tables.addEncodedQuery('super_classISEMPTY^nameNOT LIKEts_c_^nameNOT LIKEsysx_^nameNOT LIKEv_');
tables.query();
while (tables._next()) {
var tableName = tables.getValue('name');
var column = new GlideRecord('sys_dictionary');
column.addEncodedQuery('name=' + tableName + '^element=sys_id');
column.queryNoDomain();
if (!column.next())
continue;
var gr = new GlideRecord(tableName);
gr.addQuery('sys_id', sys_id);
gr.queryNoDomain();
if (gr._next()) {
gs.info('!url=' + gr.getLink());
break;
}
}
Note: the script will output "!url=https://this.is.your.url/" to automatically redirect user to specific URL after the script has been executed.
6. Click "Save"
- 1,009 Views