Custom related list to displays child incident sla records

bhargavi143
Tera Contributor

In the Incident form new related list should be added which displays the sla records of the child incidents of that particular incident.
How to achieve this functionality.



Thanks in advance
Bhargavi.

2 ACCEPTED SOLUTIONS

Thanks @Mio Matsushita for posting the whole solution here, all you need @bhargavi143.

View solution in original post

@bhargavi143 , credit should go to @Mio Matsushita.

Please accept his solution, you can mark that "accepted solution" also. 

View solution in original post

3 REPLIES 3

Mio Matsushita
Mega Sage

Hello

 

This can be achieved through Relationship.

Go to [System Definition > Relationships] and create the following relationships in the sys_relationship table.

image1.png

(function refineQuery(current, parent) {
    var gr = new GlideRecord('incident');
    gr.addQuery('parent', parent.sys_id);
    gr.query();
    sys_ids = [];
    while (gr.next()) sys_ids.push(gr.sys_id.toString());
    current.addQuery('task', 'IN', sys_ids);
    current.query();
})(current, parent);

Next, open the related list settings for the Incident table and add "Child Incidents SLAs".

image2.png

The SLAs of the child incidents of the incident you are viewing are now displayed in the related list.

The screenshot shows the related list for the INC0010001(Parent) form.

image3.pngimage4.png

Thanks @Mio Matsushita for posting the whole solution here, all you need @bhargavi143.

@bhargavi143 , credit should go to @Mio Matsushita.

Please accept his solution, you can mark that "accepted solution" also.