NullPointerException on service catalog rest api GET /sn_sc/servicecatalog/items/{sys_id}

wryanr
Tera Contributor

I've been trying to learn the REST API and have hit a wall. I'm able to generate Incident and Change tickets and now I'm trying to create RITMs. I started by running some GET tests on the catalogs and categories and was successful at doing a GET /sn_sc/servicecatalog/items. When I tried to do a GET /sn_sc/servicecatalog/items/{sys_id} I kept getting a NullPointerException. Here are the details.

I started with the following GET (I'm using Postman if that matters). I have the authentication verified and all necessary roles, also verified.

https://MYINSTANCEREDACTED.service-now.com/api/sn_sc/servicecatalog/items

This gave me the expected result

success on items.PNG

Then I performed the next GET using a sys_id of an item from the result above. I also verified the sys_id in the instance from Maintain Items

https://MYINSTANCEREDACTED.service-now.com/api/sn_sc/servicecatalog/items/03b153c92b4e85004f1c769bf8...

I get the NullPointerException here.

error on item sys id.PNG

Any ideas on why the GET sys_id is failing?

1 ACCEPTED SOLUTION

wryanr
Tera Contributor

Well, I found the issue.




ServiceNow KB: SC Catalog Get API returning java.lang.NullPointerException if the "Data Lookup and R...



Looks like there's a plugin that activated in new instances, but not ones that are upgraded. I activated these plugins and the REST calls are working now.



Thanks for everyone's help.



William


View solution in original post

10 REPLIES 10

wryanr
Tera Contributor

Well, I found the issue.




ServiceNow KB: SC Catalog Get API returning java.lang.NullPointerException if the "Data Lookup and R...



Looks like there's a plugin that activated in new instances, but not ones that are upgraded. I activated these plugins and the REST calls are working now.



Thanks for everyone's help.



William