Displaying problem record in the related list tab of the incident automatically ??if the Problem record exisits ..

roopashree e
Mega Contributor

displaying if an incident has a problem record attached then incident's related list tab called " problem " should display the problem record automatically , please a advice how to achieve this ..awaiting response .

1 ACCEPTED SOLUTION

Hi Roopashree,

Is problem_id field on incident populated with the problem record?

If yes then only the related list will show that problem record; if not then it won't show since query is based on that field

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

15 REPLIES 15

harishdasari
Tera Guru

Hi Roopashree,

system definitions --> relationship

find_real_file.png

 

Now click on the New Button and write the code as shown here in the screenshot. This will fetch the related problem records in incident table.

find_real_file.png

Now Navigate to the Incident --> Configure --> form layout.

Now select the "PROBLEM" tab you have created and you can search for the Relationship you have created in your previous step and add it under the problem tab.

Now save it and you can see that related records will be displayed for the related CI.

Thank you.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

on problem form related list can be added by configure related list since incident has a problem_id field which refers to problem

Is the relationship defined for this ? if not then you need to create a relationship between those 2 tables

1) in left navigation type relationships under system definition

2) click new -> give name you want Problem for Incident

3) applies to table -> incident

queries from table -> problem

script as below

(function refineQuery(current, parent) {

// Add your code here, such as current.addQuery(field, value);

// parent refers to record on which related list to be shown

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

})(current, parent);

screenshot below

find_real_file.png

now go to incident form; configure related list; search for the related list with the name given in step 3 and add click save

find_real_file.png

If there is a problem associated to this incident record it will show up then

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Perfect..!!! It working ..

 

Thank you 🙂

@krithvik 

Glad to help.

Please mark response helpful.

Regards
Ankur

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