API to query sc_req_item, sc_task

Feddy
Kilo Sage

Hi Team , 

We have a request to create API to query sc_req_item and sc_task table based on following fields, 

API can get a list of RITM and SC_TASK based on
 
State
Assignment group
Assigned
Short Description
Service
Business hub
Business function
Priority

should I use OOB API or scripted rest messages(if the response body needs to be changed)?

any update on this would be much appreciated.

Thanks,
Feddy
10 REPLIES 10

Saurav11
Kilo Patron
Kilo Patron

Hello,

It depends on the requirement.

If you have all the fields directly available on the sc_req_item and sc_task, then you can use the simple OOB API.

But if you have complex conditions then you can go for Scripted rest API.

Also Scripted rest API gives you more control in regards to the output. It is also easier to amke changes in the future and from maintenance point of view.

Please mark answer correct/helpful based on Impact

ersureshbe
Giga Sage
Giga Sage

Hi,

You can use the API with below 3 options.

1. Table API - use direct table and generate the end point.

2. Import Set API - Create import set for mentioned table and generate the end point.

3. REST API - Create the custom REST API and generate the end point.

1st option is not recommendable. 2 and 3 is advisable. If required business related custom response message you select the Custom REST API else you can go  with Import Set API and End Point.

Please mark as correct answer / helpful if helped.

Regards,

Suresh.

 

Regards,
Suresh.

do we have any oob api to query service catalog request item and catalog task based on certain fields and item variables? if not , I need to go with scripted rest api right?

Hello Feddy,

As I had mentioned in my answer it depends on the requirement

For your case you can easily create an OOB API from rest API explorer for both the tables.

But in the longer run it is advised you use Scripted rest API. So I would suggest go with Scripted rest API.

But if in your project other developers use the OOB setup more frequently then you may use that.

Please mark answer correct/helpful based on Impact

Thanks.