Lukasz_Krzaczko
Giga Expert

Result:

1. When logged in, click SwissNow/Custom Scripts, paste sys_id to be found and press Enter:

find_real_file.png

 

2. Record with specific sys_id will be open

find_real_file.png

 

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

find_real_file.png

 

4. Provide script name and required parameters (in this case - "sys_id"). Then click "Add" to add the parameter.

find_real_file.png

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"

 

Version history
Last update:
‎07-16-2019 12:57 AM
Updated by: