We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Assign task to catalog item dynamically

caliban
Tera Expert

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

 

7 REPLIES 7

arielgritti
Mega Sage

Hello

Maybe this approach can help you

Take a look to the System Policy - Assignment

You can create a assignment for the sc_task table filtering by catalog item's variables and assign to a group

 

find_real_file.png

 

I hope my answer has been useful
Ariel
PS: Please mark my answer correct or helpful if I have helped you. Thanks

Hi Ariel,

 

That looks really handy thanks.  Do you know if assignment rules supersede tasks set on the item?  Can I remove any tasks that already exist on the item and just let Assignment rules create the tasks based on the variables?

 

Caliban

Hi Caliban

Look at this: https://docs.servicenow.com/bundle/kingston-platform-administration/page/administer/task-table/concept/c_AssignmentRulesModule.html

 

And this:

https://docs.servicenow.com/bundle/kingston-platform-administration/page/administer/task-table/concept/c_PrecBetweenAssignmentAndBusRules.html

 

Maybe that's documents can help you

 

What I would do.
I do not delete the task, only set empty the assigned_to and assignment_group.
Create the assignment rule and update the task (another field) and check if it's assigned

 

Ariel

Hi Ariel,

 

Thanks again, I had already checked the documentation but it doesn't shed any more light on the situation.  You are unable to set a task with an empty assignment user or group, but nothing gets assigned if I remove the task.