Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Resolve action in emplyee center

Yaron Rabinovi1
Tera Expert

 

Hello everyone
When I click to resolve an incident from the portal, I should fill in the assigned_to field as a mandatory field.

How can the field be made non-mandatory?

 

Currently, as this is a required field, the incident cannot be resolved from within the portal by the end user.

I need that if the field assigned_to is empty it will become optional and not mandatory before the incident is resolved.

 

Resolution code
will be "Resolved by caller".

 

I would love to know how to do this.

2 REPLIES 2

Saurabh Bhoi
Tera Contributor

Hi Yaron, 

 

 

 

1. Log in to your ServiceNow instance.

2. Use the filter navigator to go to System Definition > Business Rule.

3. Find and open the business rule that makes the `assigned_to` field mandatory when resolving an incident.

 

1. In the business rule, navigate to the Script

2. Add a condition to the script to check if the resolution code is "Resolved by caller". If it is, the `assigned_to` field should not be mandatory.

 

Here is an example of how you might modify the script:

// Check if the incident is being resolved

if (current.state == 'Resolved') {

    // Check if the resolution code is not "Resolved by caller"

    if (current.u_resolution_code != 'Resolved by caller') {

        // If 'assigned_to' is empty, show an error message and abort the action

        if (!current.assigned_to) {

            gs.addErrorMessage('The Assigned To field is mandatory.');

            current.setAbortAction(true);

        }

    }

}

```

 

In this script:

- `current.state == 'Resolved'` checks if the incident is being resolved.

- `current.u_resolution_code != 'Resolved by caller'` checks if the resolution code is not "Resolved by caller".

- If both conditions are true and `assigned_to` is empty, it shows an error message and aborts the action.

 

1. Save the changes to the business rule.

2. Create a test incident and try resolving it with the resolution code "Resolved by caller".

3. Verify that the `assigned_to` field is not mandatory in this case.

 

By following these steps, you should be able to make the `assigned_to` field optional in ServiceNow when the resolution code is "Resolved by caller", allowing users to resolve incidents from the portal without filling in this field.

 

Ankur Bawiskar
Tera Patron

@Yaron Rabinovi1 

there seems a data policy which is blocking that

Did you check that?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader