State Changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Team,
I have a requirement in ServiceNow.
On RITM (Requested Item – sc_req_item), I need to automatically update the Work Notes whenever the State field changes. This should work for all state values (like Open, Pending, Work in Progress, Closed, etc.) and capture the old state and new state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @mallelakuma,
it sounds like on after business rule. Create one and share your progress here to help you finalise it
Answers generated by GlideFather. Check for accuracy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @mallelakuma
Use after Business Rule to capture both the prior and updated state values of a variable.
- Table: sc_req_item
- When: after
- Insert/Update: Checked
- Filter Conditions: State Changes // Mention condition as per your requirement
- Sample Script://Update script as per your requirement
(function executeRule(current, previous /*null when async*/) { current.work_notes = "State changed from " + previous.state.getDisplayValue() + " to " + current.state.getDisplayValue(); current.setWorkflow(false); current.update(); })(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @mallelakuma ,
For old value and new value requirement, in business rule there is current and previous object so you can achieve your requirement using business rule .
If this helps you then mark it as helpful and accept as solution.
Regards,
Aditya
