Clear Assigned To when Assignment Group is Change?

John Vo1
Tera Guru

Is there any way to clear the "Assigned to:" when you change the "Assignment Group"?

I have seen a couple of times where for example the incident Assignment Group is set to Desktop Support — Houston and the assigned to is Joe, then I would set the incident Assignment Group to Desktop Architecture, hit save, and it would keep the Assigned to as Joe even though I am not in that group.

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi John,



Use an onChange client script on the Assignment Group field something like this:



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


      if (isLoading)


                  return;



        g_form.setValue('assigned_to', '');


}


View solution in original post

6 REPLIES 6

Chuck Tomasi
Tera Patron

Hi John,



Use an onChange client script on the Assignment Group field something like this:



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


      if (isLoading)


                  return;



        g_form.setValue('assigned_to', '');


}


Thanks Chuck for your response on this.   Awesome once again.


John Vo1
Tera Guru

Chuck,



What about on a TASK?   Can the Assigned To be empty if Assignment Group is change?



Thanks,


John


I'm not sure I understand the question/issue so I'll see if I can cover all bases...



That's up to you where you want to apply this client script. Remember, client scripts are inherited unless you specify otherwise. If you create a client script on Task (task), it will be used by incident, problem, change, and all other tables that are extended from task.



If you want to make the assignment group mandatory, just tell it.



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


      if (isLoading)


                  return;



        g_form.setValue('assigned_to', '');


        g_form.setMandatory(assigned_to', true);


}