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
Mega Sage

Try below script:

var grRITM = new GlideRecord("sc_req_item");
grRITM.addQeury("request", current.request);
grRITM.query();
gs.log("Count is: " + grRITM.getRowCount());
If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

View solution in original post

RaghavSh
Kilo Patron

Try changing addQuery to"

 

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

 

Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023
LinkedIn

View solution in original post

4 REPLIES 4

Ahmmed Ali
Mega Sage

Try below script:

var grRITM = new GlideRecord("sc_req_item");
grRITM.addQeury("request", current.request);
grRITM.query();
gs.log("Count is: " + grRITM.getRowCount());
If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

RaghavSh
Kilo Patron

Try changing addQuery to"

 

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

 

Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023
LinkedIn

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);