- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2019 07:05 AM
Hi Guys,
My requirement: I need to update the incident records to close state from the created date with filter conditions as I have used in below fix script and I am getting the below error "Javascript compiler exception: missing ) after argument list (null.null.script; line 3) in:"
var inc = new GlideRecord('incident');
inc.addEncodedQuery('active=true^assignment_group=ba1859496f000200c0c334afae3ee406^sys_class_name=incident^short_descriptionLIKEPercent Used Space is too high::AlertKey^sys_created_on>=javascript:gs.dateGenerate('2019-04-24','10:00:00')');
inc.query();
gs.print(inc.getRowCount());
Regards,
Sivakumar
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2019 07:07 AM
Here:
('active=true^assignment_group=ba1859496f000200c0c334afae3ee406^sys_class_name=incident^short_descriptionLIKEPercent Used Space is too high::AlertKey^sys_created_on>=javascript:gs.dateGenerate('2019-04-24','10:00:00')');
change to double quotes:
("active=true^assignment_group=ba1859496f000200c0c334afae3ee406^sys_class_name=incident^short_descriptionLIKEPercent Used Space is too high::AlertKey^sys_created_on>=javascript:gs.dateGenerate('2019-04-24','10:00:00')");
The single quotes surrounding your date is interfering with the quotes around your query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2019 08:18 AM
Try the URL to see if you are getting any incidents in the list.
https://yourinstance.service-now.com/incident_list.do?sysparm_query=active=true^assignment_group=ba1859496f000200c0c334afae3ee406^sys_class_name=incident^short_descriptionLIKEPercent%20Used%20Space%20is%20too%20high::AlertKey^sys_created_on%3E=javascript:gs.dateGenerate(%272019-04-24%27,%2710:00:00%27)
Vinod Kumar Kachineni
Community Rising Star 2022