Assign task to catalog item dynamically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2018 08:02 AM
I'm looking to assign the tasks for a Catalog item based on what information is submitted via the portal.
For example if a location select box is on the Catalog item with East Coast, West Coast and Central, I would like the Catalog task on the RITM to be generated correctly for the right group that will be carrying out the work.
I had a look at the documentation on Scripted Tasks that suggests this might be what I'm looking for, but does anyone have any examples of code or how to do this?
Thanks
- Labels:
-
Request Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2018 12:15 AM
Hello
I'll make some test in my dev instances and answer you asap
Ariel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2018 01:03 AM
Hello
Look at "my lab's tests".
I did create a simple workflow to create a SCTask without assignment group defined.
No "fixed" assignment made.
Only "populate" the SCTask's location field
When create a request with this SC Item the SCtask was created with empty assignment group.
Then, I did create a "assignment" to the sc_task table with this filter.
When create a new request with the "assignment" active, the SCTask was assigned to the assignment group
I hope my answer has been useful
Ariel
PS: Please mark my answer correct or helpful if I have helped you. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2018 03:31 AM
you can create a table with fields and name table as "location routing"
then in the workflow of catalog task -> script part add this code
var gr = new GlideRecord('table_name');
gr.addQuery('u_catalog_item', current.cat_item);
gr.addQuery('u_location_id', l_id);
gr.query();
while(gr.next())
{
task.assignement_group = gr.u_assignemnt_group;
}
it will applies to multiple catalog item swith multiple groups based on locations