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
04-03-2016 12:46 PM
Thank you for the feedback Kumar.
