I want to make assignment group mandatory

PRAGHATIESH S
Tera Expert

Hi,

I want to make assignment group mandatory in all the state even in new state, but while create new that time it should not be mandatory after save the incident it will be mandatory.

 

Can anyone tell me, how to achieve it

2 ACCEPTED SOLUTIONS

Najmuddin Mohd
Mega Sage

HI @PRAGHATIESH S ,

You can use the on-load client script.

if(!g_form.isNewRecord()){

 g_form.setMandatory('assignment_group');

}


If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.

View solution in original post

Robbie
Kilo Patron
Kilo Patron

Hi @PRAGHATIESH S,

 

You can easily achieve this via a UI policy. Essentially in the script (As shown below), you can check to see if the record is new or not. (Whether its been created or not)

 

Use the following syntax in the 'Execute if true' script area:

function onCondition() {
    if (!g_form.isNewRecord()) {
		g_form.setMandatory('assignment_group', true);
    }
}

 

Screenshot 2024-11-29 at 10.38.57.png

 

To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.





Thanks, Robbie

View solution in original post

5 REPLIES 5

Najmuddin Mohd
Mega Sage

HI @PRAGHATIESH S ,

You can use the on-load client script.

if(!g_form.isNewRecord()){

 g_form.setMandatory('assignment_group');

}


If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.

Sandeep Rajput
Tera Patron
Tera Patron

@PRAGHATIESH S You can plan to create a UI Policy which triggers when the state is not New (add UI Policy condition State is not New) and in UI Policy Action add the Assignment group field to make it mandatory.

 

Hope this helps.

Robbie
Kilo Patron
Kilo Patron

Hi @PRAGHATIESH S,

 

You can easily achieve this via a UI policy. Essentially in the script (As shown below), you can check to see if the record is new or not. (Whether its been created or not)

 

Use the following syntax in the 'Execute if true' script area:

function onCondition() {
    if (!g_form.isNewRecord()) {
		g_form.setMandatory('assignment_group', true);
    }
}

 

Screenshot 2024-11-29 at 10.38.57.png

 

To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.





Thanks, Robbie

Runjay Patel
Giga Sage

Hi @PRAGHATIESH S ,

 

No need to write any script and the best way to do is using UI Policy. Follow below steps.

1. Create one ui policy and put condition state is new.

RunjayPatel_0-1732877064634.png

 

RunjayPatel_1-1732877128495.png

 

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------