Create records in target table using Import Set API

vvkdby
Kilo Explorer

I have created a staging table for the Incidents table. Next, I created an Access Control for the "create" operation on this staging table. This access control has no roles attached to it. This allows me to create a user, and using it, write into the staging table, and consequently the Incidents table just fine.

Next, I create a role(Let's call this role x-role for the sake of this discussion), which doesn't 'Contain' any other roles. Now, I attach this role to my Access Control for the staging table. I create a user that has x-role attached to it, and I use it to do the same operation as before. But, now when I try to create a record in staging table, I get this error:

{

      "error": {

              "detail": "Required to provide Auth information",

              "message": "User Not Authenticated"

      },

      "status": "failure"

}

This error goes away and I'm able to create records again if I simply attach the "rest_service" role to my aforementioned Access Control.
Is this expected behavior? Why/Why not? Am I missing something in my role(x-role)?

Note: I am on Helsinki version and the docs say that I don't need the rest_service role(which is deprecated) anymore to create records in the staging table.

3 REPLIES 3

Chandu Telu
Tera Guru
Tera Guru

Hi vivek,



Did you tried to create a record manually in that table from native service-now to test you have cretae access on that table


Yes, using the same user, I can create a record in the native Incidents table.


Hello Vivek,



Try granting the custom role + import set related roles (import_transformer) and check once.


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