- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2018 08:24 AM
plz tell where the problem is in this code. this is not assigning the task to found group
var groupSysID ;
var groupName = current.variables.group_name;
var gr = new GlideRecord("sys_user_group");
gr.addQuery("name", "groupName");
gr.query();
if (gr.next()) {
groupSysID = gr.sys_id;
gs.addInfoMessage("found group" + gr.sys_id);
task.assignment_group = groupSysID;
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2018 09:58 AM
var groupName = current.variables.group_name;
var gr = new GlideRecord("sys_user_group");
gr.addQuery("name", groupName);
gr.query();
if (gr.next()) {
var groupSysID = gr.sys_id;
gs.addInfoMessage("found group" + gr.sys_id);
task.assignment_group = groupSysID;
}
** i used groupName in double quotes ("") which was creating problems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2018 09:17 AM
Where are you running this script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2018 09:46 AM
in workflow RUN SCRIPT section/utilities
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2018 09:52 AM
Ok, assuming that before this snippet of code, you've found the task via gliderecord and that glide record variable is called task, then add task.update().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2018 09:58 AM
var groupName = current.variables.group_name;
var gr = new GlideRecord("sys_user_group");
gr.addQuery("name", groupName);
gr.query();
if (gr.next()) {
var groupSysID = gr.sys_id;
gs.addInfoMessage("found group" + gr.sys_id);
task.assignment_group = groupSysID;
}
** i used groupName in double quotes ("") which was creating problems