How to auto-change Incident state from On Hold to In Progress on reassignment and make Work Notes ma

nameisnani
Mega Sage
Hi Team,
 
I need guidance on implementing the following requirement in ServiceNow Incident Management:
 
Requirement:
 
When an Incident is currently in "On Hold" state and the ticket is reassigned (Assignment Group or Assigned To changes), the system should automatically update the State to "In Progress".
 
Additionally, during this transition, "Work Notes" should be made mandatory to ensure proper documentation of the reassignment activity.
 
Details: -
Current State: On Hold - Action: Reassignment (Assignment Group or Assigned To changes)
- Expected Behavior:
1. Incident State should automatically change to "In Progress"
2. Work Notes field must be mandatory during this update
 
If anyone has implemented a similar requirement, please share your approach.
 
please provide me the configuration steps to achieve thsi requirment 
 
Thanks in advance for your help!
10 REPLIES 10

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

Hi @Tanushree Maiti 

 

nameisnani_0-1782721372010.png

 

 

opertaor changes is not there in ui policy .

 

 

Hi @nameisnani 

 

My Bad. Updated solution. check it. Use onChange client script.

 

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

@Tanushree Maiti  

 

when incident get created - worknotes become mandtory

nameisnani_0-1782725552894.png

 

Hi @nameisnani 

 

In the client script , add a IF condition when old value not equal to new value , then set Work notes mandatory. do it for the both the script and share the result.

 

 

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