Using REST API to get all SCTASKs under an RITM

Akshaya R
Tera Contributor

Hi All,

 

I am trying to retrieve all the SCTASKs under a given RITM using REST API. My RITM has 3 SCTASKs under it and I am unable to retrieve all the sctask numbers by providing the sys_id of ritm on sc_req_item table while I am able to get the request number using request.number.

 

My question is how can I get all the SCTASK numbers by providing the RITM details?

 

Thanks,

Akshaya

2 ACCEPTED SOLUTIONS

RaghavSh
Kilo Patron

See below screenshot to get all tasks using REST API explorer:

Screenshot 2022-11-28 at 2.17.56 PM.png

 

 

 

 

 

 

 

 

 

If you are using REST API explorer you need to set sysparm_limit.


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023

View solution in original post

Brijesh10
Tera Guru

Hi ,

Please use table sc_task for REST API and add filter/query parameter request item number/sys_id . This will return the related catalog tasks where the catalog tasks belong to the given RITM

 

Parent Field on catalog task i.e. Request item

Brijesh10_0-1669625259490.png

 

 

Resi Api Explorer 

Brijesh10_2-1669625394134.png

 

 

 

Please mark correct if helpful.

 

Regards,
Brijesh Sahani

ServiceNow Developer

View solution in original post

4 REPLIES 4

RaghavSh
Kilo Patron

See below screenshot to get all tasks using REST API explorer:

Screenshot 2022-11-28 at 2.17.56 PM.png

 

 

 

 

 

 

 

 

 

If you are using REST API explorer you need to set sysparm_limit.


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023

Thank you for the quick response Raghav!

Brijesh10
Tera Guru

Hi ,

Please use table sc_task for REST API and add filter/query parameter request item number/sys_id . This will return the related catalog tasks where the catalog tasks belong to the given RITM

 

Parent Field on catalog task i.e. Request item

Brijesh10_0-1669625259490.png

 

 

Resi Api Explorer 

Brijesh10_2-1669625394134.png

 

 

 

Please mark correct if helpful.

 

Regards,
Brijesh Sahani

ServiceNow Developer

Thank you for helping Brijesh!