HI, I want to get all type of tickets such as Incident, Service and Change requests by one Service now Rest API call.

Pavan Kumar22
Kilo Contributor

HI, I want to get all type of tickets such as Incident, Service and Change requests by one Service now Rest API call.As API's are defined and accessible with table api's,i could only provide only one endpoint to access specific table related tickets.But i want to have incident,service and change requests details in one GET call to fetch for the project.

1 ACCEPTED SOLUTION

josh_nerius
ServiceNow Employee
ServiceNow Employee

Hi Pavan, 

Can you share why you need this to be a single call? 

All of the tables you mentioned are children of the Task table. You could retrieve tasks using the Table API: 

GET /api/now/table/task

This will return records from all tables that descend from Task, so you'll need to add some filters to show only the record types you need. 

Note that you can only get fields that are common across all task tables. 

View solution in original post

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Pavan,

 

You can query the Task table instead of querying individual table.

 

-Pradeep Sharma 

josh_nerius
ServiceNow Employee
ServiceNow Employee

Hi Pavan, 

Can you share why you need this to be a single call? 

All of the tables you mentioned are children of the Task table. You could retrieve tasks using the Table API: 

GET /api/now/table/task

This will return records from all tables that descend from Task, so you'll need to add some filters to show only the record types you need. 

Note that you can only get fields that are common across all task tables. 

Pavan Kumar22
Kilo Contributor

Hi,

 

Thanks for your responses.

 

We are using these to access service now via API’s in our application for collecting ticket details.

Currently we are using

  • JSONV2 web services and
  • Rest API

 

I will get back to you after testing these services within our application on feasibility and accuracy to set for our requirement.

 

Again Thanks for your quick response.

 

Regards,

Pavan.

Pavan Kumar22
Kilo Contributor

I used to have incident_state field in incident table API,and i used to update state to other state like "Assigned".

Now when i started using task table API,incident_state is not getting changed and it is still like "New".

i used state field of task table but it is not getting changed.

How can i do in order to change child table fields?  for now  i require to change "incident_state" field and it should get updated to "Assigned" and i am passing "incident_state":"11" as body to  API.

what can i do to change child table field?

 

Thanks & regards,

Pavan.