Add values coming from different tickets to a list collector without removing old ones
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 06:36 AM
Hello,
I am having a list collector field on a parent ticket which will get change requests associated with different child tickets related to the parent ticket. sometime same change number is associated with different child tickets and so i want to restrict the adding of same change number multiple times. however i can restrict the duplicate ones, but its also removing the existing tickets added to parent ticket and adding the values coming from child tickets. How can i add the change values coming from different child tickets without adding duplicate and without removing old tickets.
I am using script as follows:
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 07:56 AM
So 1 parent can have multiple childs.
so that list field is storing child CHGs?
where are you writing this script and what debugging did you perform?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 10:42 AM
Hello @Ankur Bawiskar
Yes, One parent can have multiple childs and its storing changes and also one child can store multiple changes. When i tried its getting added two times, means its getting duplicated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 08:09 PM
then it seems the child has duplicate changes populated in that field and hence it's causing the issue
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 08:32 PM
Hello @Ankur Bawiskar
Child may have multiple changes and a change can link to multiple childs under same parent. From child tickets I am getting valid response after removing duplicates. Only when we are passing them to parent, they are duplicated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 09:32 PM
so what debugging did you do?
Any child has duplicate change inside it?
share the logs before and after making the unique array check
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader