Illegal access error in workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2020 06:45 AM
Ive written the below code in an 'Approval - User' activity on a workflow. Its purpose is to pull users from a glide list field on the software table (the field itself is on the cmdb_ci table) and add them as approvers on a REQ task. However im getting this error: Illegal access to getter method getMessage in class org.mozilla.javascript.RhinoException
Please dont mock my code too much, im not a coder and most of my codes are frankensteins monsters from other bits of code people have written:
var r = new GlideRecord('sc_req_item');
r.addQuery('request',current.sys_id);
r.query();
if(r.next())
{
var Approvers = (r.Variables.please_select_the_software_you_would_like.u_sw_add_approvers) ;
}
{
answer.push = Approvers;
}
Thanks for any assistance.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2020 01:45 AM
Hi,
Unfotunately this doesnt work. Ive also used it in conjuction with the script
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2020 08:15 AM
Why you are not pushing approvers like this:
var r = new GlideRecord('sc_req_item');
r.addQuery('request',current.sys_id);
r.query();
if(r.next())
{
var Approvers = (r.Variables.please_select_the_software_you_would_like.u_sw_add_approvers.toString()) ;
}
answer.push(Approvers);
Please mark as Correct Answer and Helpful, if applicable.
Thank You!
Abhishek Gardade
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2020 01:41 AM
Thanks for the reply.
Ive tried this full script and its still throwing back the same error.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2020 01:51 AM
Hi Oliver,
Can you share the updated script?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2020 06:07 AM
var r = new GlideRecord('sc_req_item');
r.addQuery('request',current.sys_id);
r.query();
if(r.next())
{
var Approvers = (r.Variables.please_select_the_software_you_would_like.u_sw_add_approvers.toString()) ;
}
answer.push(Approvers);