Related list to show all the Parent and Child Cases associated with a case ticket

Spandana P
Tera Contributor

Hi Community!

We have a requirement where we need to add a related list to the form of Case record that includes all the other case tickets (both parent and child tickets ) linked to it.

We already have the OOB related list which shows all the tickets for which our given ticket is a parent (comes from the OOB parent field on the form). If there is no child tickets associated to that ticket, it shows “no records to display”.

The ask from them is that there should be a related list with which they can navigate to Parent ticket from child ticket just like they can navigate to child tickets from the parent ticket as shown in figure below.

Is it possible to create one related list like this (without introducing child field on the form). Is there any possibility to show all the associated parent and child tickets in one related list? If this is not possible, how to create related list for parent tickets from child ticket?

 

Pic 1: Case 001 has the child records as shown (these are all the tickets for which case001 is the parent, similarly, they want a related list which includes the tickets for which case 001 is the child. They want all these to be shown in same related list if possible

find_real_file.png

Pic 2: child case form

find_real_file.png

find_real_file.png

Here instead of just showing the tickets for which 004 is the parent , they want all the linked tickets to be shown here (instead of “child cases” related list, we need related cases” related list, so even the 001 ticket should be shown here as it is the parent.)

Please help me!

Thanks in advance.

1 ACCEPTED SOLUTION
7 REPLIES 7

lrossy31
Tera Expert
Tomasz and Spandana, is it possible to create this in a scoped app? if so which fields should I use instead of parent. I have tried using number and the reference field I have created for the relationship between the two tables and cannot get it to work properly.
 
Will greatly appreciate your help.
 
Luis

Hi,

I think this is possible for scoped app too, all you need is a reference field that establishes a relation between those two tables. In my case, I wanted to show parent and child case tickets for a given  case ticket.

so in the relationship table , both my "applies to the table" and "queries to the table" will be case table only. The reference field that establishes relationship between them is the "Parent" field on the form.

 

The code I used is :

 

(function refineQuery(current, parent) {

current.addQuery('parent',parent.sys_id).addOrCondition('sys_id',parent.parent);

})(current, parent);

By default servicenow allows only one parent ticket to a ticket so even with this related list we will be able to add new child tickets to a given ticket  but not new parent ticket.

 

If this didn't help , please let me know what is your requirement maybe I will try if I can find any solution.

Hello Spandana,

Thank you for the reply. Essentially I want to have both forms to show their related requests. If I enter a new item I will also like to see the maintenance form for it and vice versa in the related lists. I can see that happening automatically to one side but on the other I have to select from the list of items to work on. Hope this makes sense. I will try to make the connection with the code provided on both tables simultaneously.