- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 03:39 AM
Hi all,
is there a possibility to log when a Business rule is modifying a field value?
Lets say, a Business Rule is changing the state of an Incident.
In the Incident this modification is logged and I can see that the state got changed from a to b through "system".
But who is "system" in this case?
Therefor: Is there a way to document that this "change" was done through Business Rule "XYZ" ?
Thanks
Oliver
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 03:56 AM - edited 12-09-2024 03:56 AM
Hey @Oliver Strein
System represents actions performed by system processes, including Business Rules, Workflows, and Flows.
By default, when a Business Rule modifies a field, the change is logged as being made by "system." However, ServiceNow does not directly log which specific Business Rule performed the modification
However there is one custom approach we can use
if (current.state.changes()) {
current.u_modified_by_br = "BR_Name"; // Replace with the actual Business Rule name
}
if (current.state.changes()) {
gs.log("State changed by Business Rule: BR_Name", "Business Rule Tracking");
}
-
if (current.state.changes()) {
current.work_notes = "State changed by Business Rule: BR_Name";
}
Thanks,
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 03:56 AM - edited 12-09-2024 03:56 AM
Hey @Oliver Strein
System represents actions performed by system processes, including Business Rules, Workflows, and Flows.
By default, when a Business Rule modifies a field, the change is logged as being made by "system." However, ServiceNow does not directly log which specific Business Rule performed the modification
However there is one custom approach we can use
if (current.state.changes()) {
current.u_modified_by_br = "BR_Name"; // Replace with the actual Business Rule name
}
if (current.state.changes()) {
gs.log("State changed by Business Rule: BR_Name", "Business Rule Tracking");
}
-
if (current.state.changes()) {
current.work_notes = "State changed by Business Rule: BR_Name";
}
Thanks,
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 04:46 AM