- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 06:53 AM
Hi All,
We have an encoded query which is being run under a function of script include for an integration. We can copy the encoded query from table but is there any possibility to check the result of that encoded query in service now table. Below is the query referencing to sc_task table.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 07:09 AM
HI @VinayKumarA
You can add a log message in the script.
var taskNum = new GlideRecord('sc_task');
taskNum.addEncodedQuery('number=' + current.u_clientitemnumber + '^request_item.cat_itemIN' + gs.getProperty('List of Catalog item') + '^active=true');
taskNum.query();
while(taskNum.next()){
gs.log("Task: " + taskNum.number + "\n");
}
If this is not suitable, then you can hard code the u_clientitemnumber and run the query in the Scripts background.
For example, u_clientitemnumber is SCTASK0001, then
From Navigate to Scripts - background and run the query.
var taskNum = new GlideRecord('sc_task');
taskNum.addEncodedQuery('number=' + 'SCTASK0001' + '^request_item.cat_itemIN' + gs.getProperty('List of Catalog item') + '^active=true');
taskNum.query();
while(taskNum.next()){
gs.log("Task: " + taskNum.number + "\n");
}
If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 07:09 AM
HI @VinayKumarA
You can add a log message in the script.
var taskNum = new GlideRecord('sc_task');
taskNum.addEncodedQuery('number=' + current.u_clientitemnumber + '^request_item.cat_itemIN' + gs.getProperty('List of Catalog item') + '^active=true');
taskNum.query();
while(taskNum.next()){
gs.log("Task: " + taskNum.number + "\n");
}
If this is not suitable, then you can hard code the u_clientitemnumber and run the query in the Scripts background.
For example, u_clientitemnumber is SCTASK0001, then
From Navigate to Scripts - background and run the query.
var taskNum = new GlideRecord('sc_task');
taskNum.addEncodedQuery('number=' + 'SCTASK0001' + '^request_item.cat_itemIN' + gs.getProperty('List of Catalog item') + '^active=true');
taskNum.query();
while(taskNum.next()){
gs.log("Task: " + taskNum.number + "\n");
}
If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.