Use of Packages calls is not permitted in scoped applications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2015 08:17 AM
I am trying to convert datetime string in GMT to EST in a processor which is a scoped application script where user session is not available to use gs.getSession().getTimeZone() object. So I am trying to use package call, my script is below.
var xDateGMT = '2015-12-17 15:39:31.179';
gs.log ( 'Date in GMT: ' + xDateGMT);
var utz = Packages.java.util.TimeZone.getTimeZone("US/Eastern");
var gdt = new GlideDateTime(xDateGMT);
gdt.setTZ(utz);
var xDateUTZ = gdt.getDisplayValue();
gs.log ( 'Date in UTZ: ' + xDateUTZ);
When I run this, getting java.lang.SecurityException: Use of Packages calls is not permitted in scoped applications.
Any help is appreciated.
Thank
Kumar
PS: This is for xMatters ondemand integration with SN, xMatters is sending the response.date in GMT and we are updating the incident with response and need to convert the GMT to EST.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2016 03:06 AM
Hi Kumar,
Did you find anything about this? I am also facing the issue now with GlideURL() call. I think must be a trick somewhere how to call them, otherwise would be too limiting.
Thanks,
Rilinda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2016 05:17 AM
Hi Rilinda,
I did not find any solution yet, We opened a hi ticket with ServiceNow and waiting for their answer. I will update here once I hear.
Thanks
Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 03:13 PM
How did achieve the resolution for the same?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2016 07:52 AM
Per ServiceNow tech support, Java code is not allowed in the scoped applications. That is why we are getting the exception.
