vaishali231
Kilo Sage

Hey @nameisnani 

Use:

  • Data Policy → Make Work Notes mandatory
  • Before Business Rule → Change State to In Progress

This is more reliable than a UI Policy because Data Policies and Business Rules are enforced across all channels, including Service Operations Workspace.

 

Step 1: Create a Data Policy

Navigate to:

System Policy → Data Policies

 

Click New

Configuration

Field

Value

Name

Work Notes Mandatory on Reassignment

Table

Incident

Active

True

Inherit

False

Conditions

State = On Hold

 

Create a Data Policy Action:

Field Name

Mandatory

Work Notes

True

Note: If the requirement is only during reassignment, the Business Rule below will enforce the final validation server-side.

 

Step 2: Create a Before Update Business Rule

Navigate to:

System Definition → Business Rules

 

Click New

Configuration

Field

Value

Name

Move On Hold Incident To In Progress On Reassignment

Table

Incident

When

Before

Insert

False

Update

True

Advanced

True

Order

100

Leave Condition blank.

 

Business Rule Script

(function executeRule(current, previous) {
    var reassigned =
        current.assignment_group.changes() ||
        current.assigned_to.changes();

    if (previous.state == 3 &&
        current.state == 3 &&
        reassigned) {
        // Validate Work Notes
        if (gs.nil(current.work_notes.toString())) {
           gs.addErrorMessage(
                'Work Notes are mandatory when reassigning an On Hold Incident.'
            );
            current.setAbortAction(true);
            return;
        }
        // Move State to In Progress
        current.state = 2;

    }

})(current, previous);

 

***********************************************************************************************************************************

If this response helps, please mark it as Accept as Solution and Helpful.

Doing so helps others in the community and encourages me to keep contributing.

Regards

Vaishali Singh

Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb