- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2023 03:42 AM
Hi, I am trying to pass the value: contact_type=self-service^reassignment_count>=1^sys_created_on>javascript:gs.dateGenerate('2023-06-21','23:59:59')
and it is not working when called in script include.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2023 06:27 AM
Hi @Mubashira ,
Since you are calling this script include from a report filter, gs.getProperty() will not work because the script include will be executed on the client side, please try to glide record the system property, try the code below:
var inc_GR = new GlideRecord("incident");
var propGR = new GlideRecord('sys_properties');
propGR.get('<SYSID of the system property>');
var encodedQuery = propGR.value;
inc_GR.addEncodedQuery(encodedQuery);
inc_GR.setLimit(500);
inc_GR.query();
while(inc_GR.next()){
var inc_sys_id = inc_GR.getValue("sys_id");
var inc_number = inc_GR.getDisplayValue("number");
//gs.print('Incident Sys_id: ' + inc_sys_id);
gs.info('Incident Number: ' + inc_number);
}
If my answer has helped with your question, please mark it as correct and helpful
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2023 07:15 AM
Thanks a lot Sagar for all your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2023 03:59 AM
@Mubashira this is encoded query right? Could you share your script include code here. I want to see how are you using this in script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2023 04:33 AM
I am calling this script include in report
Yes the encoded query which I am declaring in system properties is:
Name: Test.Encoded.Query.A.MQ
contact_type=self-service^reassignment_count>=1^sys_created_on>javascript:gs.dateGenerate('2023-07-21','23:59:59')
And the script include is:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2023 06:27 AM
Hi @Mubashira ,
Since you are calling this script include from a report filter, gs.getProperty() will not work because the script include will be executed on the client side, please try to glide record the system property, try the code below:
var inc_GR = new GlideRecord("incident");
var propGR = new GlideRecord('sys_properties');
propGR.get('<SYSID of the system property>');
var encodedQuery = propGR.value;
inc_GR.addEncodedQuery(encodedQuery);
inc_GR.setLimit(500);
inc_GR.query();
while(inc_GR.next()){
var inc_sys_id = inc_GR.getValue("sys_id");
var inc_number = inc_GR.getDisplayValue("number");
//gs.print('Incident Sys_id: ' + inc_sys_id);
gs.info('Incident Number: ' + inc_number);
}
If my answer has helped with your question, please mark it as correct and helpful
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2023 07:14 AM
Yes!!!! Thanks a lot Karan. Your answer is making my report work.