How to add assignment group mandatory to Assess UI Action?

Ash41
Kilo Sage

Hi Team, 

 

On Problem we have OOB UI action "ASSESS", it contains assigned to mandatory, I want to add assignment group as well mandatory on same UI action. how to do it? please help

1 ACCEPTED SOLUTION

Hello @Ash41 ,

1. Write a Ui policy for making Assignment group Mandatory in Assess state.

Eeshamayeekon1_0-1684921030830.png

2.  Click on Configure Form Layout and in "Assess Dailog form View" Add assignment group field and save.

Eeshamayeekon1_1-1684921132621.png

3. You can see assignment group Mandatory on Assess button now.

Eeshamayeekon1_2-1684921181910.png

Please Mark as Helpful if this provides solution for your question.

 

View solution in original post

6 REPLIES 6

Amit Gujarathi
Giga Sage
Giga Sage

HI @Ash41 ,
I trust you are doinbg great.

  1. Go to the "ASSESS" UI action record in ServiceNow.
  2. In the script section, you'll find the code that defines the behavior of the UI action.
  3. Look for the line of code that sets the "assigned_to" field as mandatory. It may look something like this:

 

g_form.setMandatory('assigned_to', true);

 

  • To make the assignment group mandatory as well, you can add the following line of code below the previous line:

 

g_form.setMandatory('assignment_group', true);

 

  • Save the UI action record.
  •  

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Amit Gujarathi
Giga Sage
Giga Sage

Hi @Ash41 ,
I trust you are doing great.

 

  1. Open the form or list where the UI action is defined. This could be a table or a record.
  2. Look for the UI action script associated with the "ASSESS" action. This script determines the behavior of the action.
  3. Find the section in the script where the assigned to field is defined as mandatory. It might look something like this:

 

 

 

function assessAction() {
  var assignedTo = g_form.getValue('assigned_to');
  if (!assignedTo) {
    alert('Assigned to field is mandatory.');
    return false;
  }
  // Rest of the code...
}

 

  1. To make the assignment group field mandatory as well, add the following code below the assigned to validation:

 

var assignmentGroup = g_form.getValue('assignment_group');
if (!assignmentGroup) {
  alert('Assignment group field is mandatory.');
  return false;
}

 

  • Save the script changes and test the "ASSESS" UI action. Both the assigned to and assignment group fields should now be mandatory when the action is triggered.
  •  

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi