- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 01:40 AM
A user submits a request in Service Portal, and based on their role, the task needs to be automatically assigned to a specific user. For example, if the user has the "HR" role, the task should go to the HR team member.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 01:46 AM
@sanyalshubh There are multiple ways to achieve this implementation.
1. Business rule: create an onAfter insert business rule on the hr task table and check the user's role and assign the task to appropriate group
2. Flow: Create a flow which triggers on the task creation, check the requestor's role and assign's the task to appropriate group
3. Assignment rule: Check the requestor role in assignment role script and assign the task
4. Catalog OnSubmit client script: Check the user role in the catalog client script and assign the task.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 02:03 AM
So I am assuming @sanyalshubh if its a record producer.. then you can write a RP script..
current.assigned_to='SYSID of Assignment Group"
or Using Business Rule :-
if (userRoles.indexOf('hr') > -1)
{
current.assigned_to = 'sys_id_of_HR_user';
}
you can use the above logic.. Let me know if that helped you..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 02:10 AM
Hi @sanyalshubh
It is either, the question is why role based ? Let say you created a record via catalog item, and you have 70 roles assigned, now on which basis system will pick the assignemnt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 01:43 AM
Hi @sanyalshubh
I’m not entirely sure about your use case, but based on roles, the assignment workflow isn’t a good fit. End users often don’t have roles, and many users have more than one role. Therefore, we need to rethink the requirements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 02:07 AM
Hi @Dr Atul - LNG its a catalog item .. record producer..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 02:10 AM
Hi @sanyalshubh
It is either, the question is why role based ? Let say you created a record via catalog item, and you have 70 roles assigned, now on which basis system will pick the assignemnt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 03:55 AM
I agree.. but this is what our business needs it.. and I asked the same but they want it to implemented.. I tried the below code provided and it worked.. but thanks for your help