- 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 01:37 AM
@SumanthDosapati it is brilliant!
This is the final code:
Thanks! Will do a couple of tests to make sure it works as expected in all scenarios, but it looks fine. 😀

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 01:40 AM
Glad that it helped. Accept the solution and mark as helpful so that it benefits future readers.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 02:00 AM
Sure, let me test it for all the scenarios: such as from problem task, to child problem, to child problem, to parent problem and so on
If this works, I will mark it as helpful...if not, I will mention you...haha!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 02:04 AM
Feel free to mention anytime 😊