Based on list collector values , create catalog task in workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2019 01:50 AM
Hi,
I have a catalog item, which contains a list collector that reference to assignment groups of servicenow.
Requirement is to create catalog task for all the assignment groups selected in list collector.
Please advice.
Thanks in advance
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2019 01:31 AM
Inside for loop print, i value.
for(var i=0;i<xyz.length; i++){
gs.log('count--'+i);
var gm = new GlideRecord("sc_task");
gm.initialize();
gm.parent = current.sys_id;
gm.request = current.request;
gm.short_description = "default task name"; //have a default task name
gm.request_item= current.sys_id;
gm.assignment_group=xyz[i];
//gm.assignment_group.setDisplayValue(xyz[i]);
//task.assignment_group = groups[i];
gm.insert();
}
Check once.