How to auto-change Incident state from On Hold to In Progress on reassignment and make Work Notes ma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hello @nameisnani ,
For this you can implement an Business Rule:
> Create a Business Rule on the Incident table.
> Trigger: Before Update
> Condition:
current.state == 'On Hold'
(current.assignment_group.changes() || current.assigned_to.changes())
> Action:
Set current.state = 'In Progress'
> also in BR add a check :
if (!current.work_notes.changes()) {
gs.addErrorMessage('Work Notes are mandatory when reassigning an On Hold incident.');
current.setAbortAction(true);
}
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
could u please provide - screenshots please
after form saves - in activites log state transistions are not capturing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
51m ago
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 a UI Policy (To Make Work Notes Mandatory)
- Navigate to: System UI > UI Policies and click New.
- Table: Incident
- Short Description: Make Work Notes mandatory on reassignment
- Condition: Assignment group changes OR Assigned to changes
- Script Tab: Check Run scripts
- Execute if true script:
function onCondition() {
g_form.setMandatory('work_notes', true);
}
- Execute if false script:
javascript
function onCondition() {
g_form.setMandatory('work_notes', false);
}
- UI Policy Action Tab: Set Work notes to Mandatory.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti