REST API Query for RITM Approver

jcshelby
Mega Contributor

I'm looking for a REST API endpoint or table that I can query to determine what the approver for a specific RITM is? In other words: for a given REQ, when the REQ is waiting on approval from another user (ex. a manager), is there a query to tell me who that person is or is there a table where that data is maintained? This is for Jakarta or Kingston.

For example, if a user opens a request that spawns a RITM, there is a task that's created for approval of that RITM. However, when I go look at the sc_tasks table I don't see that task present in the query response. I saw in the doc that the approver information is maintained in an extension to this table, but I'm not sure what table that would be or how I can query it. I also didn't see the approver information listed in the response when querying the sc_request table, though I did see that one of the fields in the response indicated that approval was in progress, but not on whom that approval was waiting.

1 ACCEPTED SOLUTION

jcshelby
Mega Contributor

I figured it out - the query seems to need to be filtered by the request table rather than the requested items table. It seems the approval is linked to the originating request rather than the RITM that's derived from that request. The query that ended up working is below. Thanks for the quick help and assistance!



https://dev21256.service-now.com/api/now/table/sysapproval_approver?source_table=sc_request


View solution in original post

5 REPLIES 5

ncp
Mega Guru

Have you looked at this table - sysapproval_approver?


jcshelby
Mega Contributor

I did try that but it seemed to produced a bunch of data related to the change_request table where I'm looking for data related to RITMs. I attempted to filter the query to items derived from the sc_req_item table but that didn't return any results


ncp
Mega Guru

This is from my developer instance, I'm able to see the RITM. Is your approval on REQ or RITM?


find_real_file.png


jcshelby
Mega Contributor

I figured it out - the query seems to need to be filtered by the request table rather than the requested items table. It seems the approval is linked to the originating request rather than the RITM that's derived from that request. The query that ended up working is below. Thanks for the quick help and assistance!



https://dev21256.service-now.com/api/now/table/sysapproval_approver?source_table=sc_request