REST API changing category of incidents

nehasr1288
Tera Expert

when I am raising an incident through REST API,in case I enter a wrong value for category field(which is a drop down field containing options like software,hardware etc.),this wrong value gets added to the choices.Please check the screenshot.I don`t want this wrong entry to make changes to my choice field.

1 ACCEPTED SOLUTION

While I don't know why the table API is doing that - it doesn't seem right to me (at first...)



Have you tried using the import set API and creating a transform map? I know there is a field called Choice Action that you can set to Create, Ignore, or Reject.



http://wiki.servicenow.com/index.php?title=Creating_New_Transform_Maps#gsc.tab=0


View solution in original post

9 REPLIES 9

nehasr1288
Tera Expert

Capture.PNG



Like the first two wrong entries are added to the category of incidents.


Below is the request I made through REST API


Capture.PNG


Chuck Tomasi
Tera Patron

HI Neha,



Sorry, no screenshot found. How are the incoming REST requests coming in? Is it via another application? Do the categories correspond? Can you provide more information how the invalid categories are getting in to the REST request? It would seem if there were programs/apps/tables on both ends with a configured set of categories, this would be a minimal risk.



FWIW, check the sys_choice table and you'll likely see that the category is not getting added so much as it is a value in the incident.category field that is being presented in blue (on the list) to indicate the value is not a valid choice.



Also, take a look at doing your import via the import set rather than creating directly through the table API. This way you can clean and transform the data before sending it to the target table.


I added a wrong value to category..instead of "software" I used "softwrae1" so it added this value to my category in incidents.



Untitled.png


So when I raise a new incident the wrong category is there


nehasr1288
Tera Expert

Capture.PNG


I am simply using a SOAPui to generate a REST request to insert an incident