Auto fill assigned to from assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 10:25 AM
Hello!
I have come across this requirement where we need to fill in 'assigned to' on change task when the assignment group has only one user in it. How do we achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 11:38 AM
Hello @Tanya Manoj ,
Suggestion: You can write an onChange client script on assignment group and call GlideAjax to check the Assignment group has how many members and pass it to the client and if the length is more than one then ignore, else you can set the assigned_to on the form.
Please Mark My Answer as Helpful and Accept as Solution, if you find this article helpful or resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 01:12 PM
Perfect @Appanna M
Adding to that,
Instead of returning the single count result, return the single user value, if it is single count and assign the assigned_to,
Else return empty.
handle this in client side. Mark @Appanna M 's reply as correct.
Thank you.
Regards,
Karunakaran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 09:25 PM
Thank you @Karunakaran for your words. @Tanya Manoj Please accept it as solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 03:41 PM
Hi there @Tanya Manoj
Guess you can use a business rule
(function executeRule(current, previous /*null when async*/) {
if (current.assignment_group.changes() && current.assignment_group.users.length === 1) {
current.assigned_to = current.assignment_group.users[0];
}
})(current, previous);
If this helps kindly accept the answer athanks much.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India