Auto fill assigned to from assignment group

Tanya Manoj
Tera Contributor

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?

4 REPLIES 4

Appanna M
Tera Guru

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.

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

Thank you @Karunakaran for your words. @Tanya Manoj Please accept it as solution. 

Its_Azar
Tera Guru

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. 

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.




Kind Regards,

Mohamed Azarudeen Z

Developer @ KPMG

 Microsoft MVP (AI Services), India