Assigned to field is empty!

Sushant20
Tera Contributor

Make the Assigned to field empty when the assignment group is not selected for incident problem change!

 

4 REPLIES 4

RaghavSh
Kilo Patron

can you elaborate the question?


Raghav
MVP 2023

On the incident form, problem or change if assignment group is not selected make assigned to field as empty for any form...

kamlesh kjmar
Mega Sage
Mega Sage

Hi @Sushant20 ,

 

To achieve this write a client script on task (we will write this on task as it needs to execute on it's multiple child i.e. incident/problem/change) with inherited checkbox checked, on assigned_to field and write the below script:

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }

    var table = g_form.getTableName(); 
    if (g_form.getValue("assignment_group") == "" && (table== "incident" || table == "problem" || table == "change_request")) {
        g_form.clearValue("assigned_to");
    }

}

 

 

kamleshkjmar_0-1672126369586.png

 

 

I hope this helps.

 

Please mark my response Helpful if this helps and Accept the response if this solves your issue.

 

Regards,

Kamlesh

jaheerhattiwale
Mega Sage
Mega Sage

@Sushant20 Tried and tested solution.

Create UI Policies to achieve this.

Create UI policies on incident, problem and change like below

jaheerhattiwale_0-1672135324979.png

 

Create a UI Policy Action under the above created UI Policy.

Check "Clear the field value" check box in Ui Policy Action

jaheerhattiwale_1-1672135405071.png

 

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023