Tanushree Maiti
Tera Patron

Hi @nameisnani 

 

You can use a combination of a Before-Update Business Rule and a UI Policy for your requirement.

 

1: Create the Business Rule (Auto-Update State)

  • Navigate to: System Definition > Business Rules and click New.
  • Name: Auto-update to In Progress on Reassignment
  • Table: Incident
  • When: Before
  • Update: Checked
  • Condition Tab: State is On Hold AND [Assignment group changes OR Assigned to changes]

 

(function executeRule(current, previous /*null when async*/) {

        current.state = 2; // Set State to In Progress

})(current, previous);

 

 

 2.Create an onChange Client Script

  • Navigate to System Definition > Client Scripts and click New
  • Fill in the following fields:
    1. Name: Make Work Notes Mandatory on Assignment Change
    2. Table: incident 
    3. Type: onChange
    4. Field name: assignment_group

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

   if (isLoading || newValue === '' || oldValue === newValue) {

      return;

   }  

      g_form.setMandatory('work_notes', true);

}

 

3: Create a onChange Client Script for "Assigned to"

  • Name: Make Work Notes Mandatory on Assignee Change
  • Table: incident 
  • Type: onChange
  • Field name: assigned_to

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

   if (isLoading || newValue === '' || oldValue === newValue) {

      return;

   }  

   g_form.setMandatory('work_notes', true);

}

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti