- 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 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
06-30-2025 04:25 AM
now my script is working fine Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2019 07:49 AM
// This compiled on my PDI
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());
//
*** Script: 0
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2019 08:12 AM