How to prevent adding duplicates in list collector

Kumar147
Tera Contributor

Hi,

A list collector field is added to Parent and child tickets.

Related tickets from multiple sub tasks are getting added to parent. When two or more sub tasks having same related ticket it is getting duplicated and adding multiple times in parent related task field. How to restrict adding of ticket if that ticket already added to parent related ticket list field. 

Thanks in advance

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Kumar147 

just before adding the values use arrayUtil unique method to remove duplicates and then set the field value

ArrayUtil - Global 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Dhana3
Kilo Sage

Hi @Kumar147 ,

 

The issue is not clear. Can you post some screenshots of what exactly is happening? Till now what you have configured and how you have configured, if you would post those scripts, that would also be helpful.

Kumar147
Tera Contributor

Hi @Dhana3 

Actually i have one parent ticket having multiple child tickets. Child tickets have change request field which will store the change related to that child ticket. I have created a business rule to pass the values of change request linked to child tickets to parent ticket. If same change request linked to multiple child tickets. change is adding multiple times to parent list collector field. How to check of the change is already added to the parent ticket and only to add new change tickets.

Ankur Bawiskar
Tera Patron
Tera Patron

@Kumar147 

just before adding the values use arrayUtil unique method to remove duplicates and then set the field value

ArrayUtil - Global 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Kumar147 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader