How to get the count of RITM records on a single request using the business rule running on RITM

Bindhu1
Tera Contributor

Hi All,

I have a requirement where I have to get the count of RITM records tagged to the request of a particular RITM  as the business rule in running on the RITM table, I tried the below thing but it doesn't seem to work, is there any other way I can get the solution.

Bindhu1_0-1667369642134.png

Thanks in advance.

2 ACCEPTED SOLUTIONS

Ahmmed Ali
Giga Sage

Try below script:

var grRITM = new GlideRecord("sc_req_item");
grRITM.addQeury("request", current.request);
grRITM.query();
gs.log("Count is: " + grRITM.getRowCount());

View solution in original post

Raghav Sharma24
Giga Patron

Try changing addQuery to"

 

gr.addQuery('request', current.request);

 

Please mark the answer correct/helpful accordingly.

View solution in original post

4 REPLIES 4

Ahmmed Ali
Giga Sage

Try below script:

var grRITM = new GlideRecord("sc_req_item");
grRITM.addQeury("request", current.request);
grRITM.query();
gs.log("Count is: " + grRITM.getRowCount());

Raghav Sharma24
Giga Patron

Try changing addQuery to"

 

gr.addQuery('request', current.request);

 

Please mark the answer correct/helpful accordingly.

Shubham Kumbhar
Kilo Guru

Hello @Bindhu1,

 

I tried the below script and it is working fine for me.

 

var gr = new GlideRecord("sc_req_item");
gr.addQeury("request", current.request);
gr.query();
gs.addInfoMessage("Total RITM Count is: " + gr.getRowCount());

 

Mark helpful and correct based on the impact 

 

Thank You

Srinivas reddy3
Mega Expert

Hi 

when i try to check the request i think you just need to modify the add query then it will work fine

gr.addQeury("request", current.request);