- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 05:35 AM
Hello,
I have added a related list on problem table called Child problems (which shows all children the particular problem has).
Now I need to add a logic that copies the work notes from child to its direct parent and I have the following scenario:
Problem A is the parent of Problem B
Problem B is the parent of Problem C
scenario 1: When the user writes a comment in work notes in Problem C, I want the specific work note to be copied only to Problem B's work notes.
scenario 2: When the user writes a comment in work notes in Problem B, I want it to be copied to Problem A
I created a business rule that copies the work notes correctly BUT the issue is that for scenario 1, the work notes get copied to Problem's B work notes, then it gets copied to Problem A's work notes - which is not desired.
Is there a solution to this?
Thank you,
Elena
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 01:28 AM - edited 05-16-2025 01:29 AM
@Elena Spıru
yeah you cannot add that in condition here but you can add it in the script in IF condition.
Sample script for your reference
var text = "ServiceNow makes work better"; //this is whole comment
var substring = "work"; //substring to check copied from
if (text.includes(substring)) {
console.log("Substring found!"); //dont copy the worknotes in this case
} else {
console.log("Substring not found."); //copy the worknotes in this loop.
}
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 12:30 AM
Hi,
Won't this if never enter?
if (!parentGR.parent.nil() && parentGR.parent == current.sys_id) {
in my scenarios,
Problem A is the parent of Problem B
Problem B is the parent of Problem C
If the comment in in the Problem C's work notes, this means that parentGR = Problem B (which won't be nil) and parentGR.parent won't be current.sysid it will be the sys if of Problem A.
So that mean it will always copy into the work notes of Problem B, then the BR gets triggered again because we have a new comment in problem B's work notes, and being run...it will copy in Problem A.
So this won't fix my issue 😞

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 01:00 AM
You can try this approach :
> While copying comments append something like 'Comments copied from PRB000001'
> Now in your BR, add a condition to check if comments doesn't contains 'Comments copied from' and also you can add another condition if you want like updated by is not system.
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 01:12 AM - edited 05-16-2025 01:13 AM
Hello,
This in an interesting idea.
My code already this message: "Work notes copied from Child Problem" + the number of the Child problem.
This is how it looks like in the parent problem:
But when I try to add it into condition, this is the only choice I have for work notes:
Unfortunately cannot add the work notes doesn't contains "Work notes copied from Child Problem"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 01:28 AM - edited 05-16-2025 01:29 AM
@Elena Spıru
yeah you cannot add that in condition here but you can add it in the script in IF condition.
Sample script for your reference
var text = "ServiceNow makes work better"; //this is whole comment
var substring = "work"; //substring to check copied from
if (text.includes(substring)) {
console.log("Substring found!"); //dont copy the worknotes in this case
} else {
console.log("Substring not found."); //copy the worknotes in this loop.
}
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 01:29 AM
Let me know if you need help with full code as well.
Regards,
Sumanth