- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2018 06:34 AM
I'm working on an approval workflow where the approval group needs to be determined from the Assignment Group. I've built a table to match assignment groups to approvers where the assignment group is a reference to sys_user_group.
The script to get the correct recipients is as follows:
workflow.info("In approval step ");
var gr = new GlideRecord("u_incident_change_management_approvers");
gr.addQuery('u_assignment_group', assignment_group);
gr.query();
if (gr.next()){
var answer = gr.u_approval_group;
workflow.info("GroupID is " + gr.u_approval_group);
}
else {
workflow.info("No approval group found");
}
When this executes as part of a Request Approval task, it generates the error message in the title. I've tried assigning the assignment_group value to a variable and passing that with the same result. The only time I don't get the error is when the second parameter in gr.addQuery is quoted. That doesn't get the error, but it also doesn't get the result I need as there is no row in the table with a value of assignment_group.
I suspect that I'm missing something simple but cannot figure out what. Any assistance will be greatly appreciated.
John
:{)
Helpful and Correct tags are appreciated and help others to find information faster
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2018 06:39 AM
if assignment_group is a variable then can you please check what value are there, it should have sys_id?
Also, have you just tried with the sys_id to test if it gives any result? like
gr.addQuery('u_assignment_group', 'SYS ID OF ASSIGNMENT GROUP');
if you are have assignment_group field on the table then I believe you should use current object.
gr.addQuery('u_assignment_group', current.assignment_group);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2018 06:39 AM
if assignment_group is a variable then can you please check what value are there, it should have sys_id?
Also, have you just tried with the sys_id to test if it gives any result? like
gr.addQuery('u_assignment_group', 'SYS ID OF ASSIGNMENT GROUP');
if you are have assignment_group field on the table then I believe you should use current object.
gr.addQuery('u_assignment_group', current.assignment_group);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2018 07:01 AM
Thank you Shishir. adding current did it.
:{)
Helpful and Correct tags are appreciated and help others to find information faster