- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 11:39 AM
Is there any way to use the query/logic from a query builder script in a fix script?
Solved! Go to Solution.
- Labels:
-
Discovery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2022 12:25 PM
Hi JJ,
Any follow up questions you have on my response, Else please mark the relevant response as correct and helpful so that this thread can be closed.
Regards
Sulabh Garg

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 11:13 PM
Hi JJ,
You can execute the CMDB query builder queries from fix script, Using the below steps
1) Go to cmdb query builder, select any of the saved queries, Run the query.
2)After query ran, it redirect the user to the "u_cmdb_qb_result" list view as shown below
3)You can copy the query in the filter and run in the fix script, or use SNUTIL extension to copy the gliderecord query and then directly run in the fix script.
Hope it helps!!
Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg
Regards
Sulabh Garg

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 10:31 PM
Hi JJ, I hope my response helped you, Do you have any follow up question on my response, If not, then please mark the response as helpful and correct, If applicable.
Regards
Sulabh Garg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2022 11:58 AM
Hi - your answer is very exciting
Can you provide me a few more details regarding"3)You can copy the query in the filter and run in the fix script, or use SNUTIL extension to copy the gliderecord query and then directly run in the fix script."?
or even an example of a fix script with the cmdb query 'query' would be great.
Joanne

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2022 12:28 PM
Below is the example I have used in the Fix script where I have used the Query Sys id in a fix script and its working.
var grUCQR = new GlideRecord('u_cmdb_qb_result_3c23bed62840ff99919d031b4a25b0b2855c1bd5');
grUCQR.addEncodedQuery("query=2c330e8f07901510d8effa7f7c1ed0d0");
grUCQR.orderBy('null');
grUCQR.setLimit(50);
grUCQR.query();
while (grUCQR.next()) {
gs.info('u_business_application_1: ' + grUCQR.getValue('u_business_application_1'));
gs.info('u_rel_business_application_1_information_object_1.type: ' + grUCQR.getValue('u_rel_business_application_1_information_object_1.type'));
gs.info('u_information_object_1: ' + grUCQR.getValue('u_information_object_1'));
}
Regards
Sulabh Garg