Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Show incidents with same configuration item in RITM related list

Vikram3
Tera Guru

I wanted to show the incidents having same cmdb which RITM has in the RITM related lists. Can someone let me know how to write the relationship for this.

1 ACCEPTED SOLUTION

Harshal Aditya
Mega Sage

Hi @Vikram3 ,

 

Hope you are doing well.

 

You just need to create a relationship (sys_relationship) and add the same in sc_req_item table's related list

HarshalAditya_0-1687332657162.png

 

Please mark this response as correct or helpful if it assisted you with your question.

Regards,
Harshal

 

View solution in original post

4 REPLIES 4

Harshal Aditya
Mega Sage

Hi @Vikram3 ,

 

Hope you are doing well.

 

You just need to create a relationship (sys_relationship) and add the same in sc_req_item table's related list

HarshalAditya_0-1687332657162.png

 

Please mark this response as correct or helpful if it assisted you with your question.

Regards,
Harshal

 

Thanks @Harshal Aditya It worked well. But I do have a snag in this. Eventhough the cmdb field is empty in RITM, incidents are visible. It shows around 5k records.

Harshal Aditya
Mega Sage

Hi @Vikram3,

 

Please try the below code -

 

(function refineQuery(current, parent) {
    current.addQuery("cmdb_ci",parent.configuration_item);
    current.addQuery("cmdb_ci","!=","");    
})(current, parent);

Thanks much. Appreciate your prompt assistance.