- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2024 01:33 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2024 02:22 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2024 02:41 AM
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);
}
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2024 02:22 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2024 02:39 AM
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2024 02:41 AM
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);
}
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2024 02:45 AM
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.
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------