Workflow Activity - Task Assignment Based on a variable.

Burhan Shah
Tera Contributor

I have created a catalog item that will have two tasks. The first task will be assigned to one of the 20 users based on the variable the end-user chose from a drop-down list of the existing emails.

 

How Can I link the Catalog Task (Assigned To) to the same as the variable end-user selected? I've attached a screenshot.

 

Regards,
Burhan Shah

Screenshot 2024-07-31 180756.jpg

4 REPLIES 4

Sumanth16
Kilo Patron

Hi @Burhan Shah , 

 

Please refer below thread:

 

https://www.servicenow.com/community/itsm-forum/dynamic-task-assignment-based-on-variable-selection/...

 

Plz mark my solution as Accept, If you find it helpful.

 

 

Thanks & Regards,

Sumanth meda

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Within the advanced script of your task you can apply something like:

 

task.assigned_to = current.variables.your_variable;

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi Mark,

 

I tried and it still didn't populate 😔 Let me know if I am doing something wrong here.

 

BurhanShah_0-1722498177596.png

 

Hi @Burhan Shah

Please note that this script is running after values are set. Try to populate your Assigned to field from Populate task variables section. Check out the following question and its solution. 

https://www.servicenow.com/community/itsm-forum/dynamic-task-assignment-based-on-variable-selection/...

 

If you found my reply useful, please mark it as solution and helpful. It will benefit me and the community.

 

Thanks and Regards,

Ehab