Empty User Record Getting inserted while creating incident through API

mayankkhurana
Tera Contributor

Empty User Record Getting inserted while creating incident through API, If payload contains a caller sys_id, that is not there in the user table so it keep on inserting a empty user record and referencing it to the caller field, I checked the ACLs user table create access is only with user_admin role and the user with which we are hitting the API it doesn't have user_admin role, only two roles are added sn_incident_read/write?

 

Need to know the reason why and How the empty record getting inserted in User table??

 

Any help will be appreciated. 

1 ACCEPTED SOLUTION

@mayankkhurana 

I did check it now and it's happening.

Ideally it should not allow since that sysId is not present in sys_user.

It's a platform bug.

Try raising a case with ServiceNow.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

6 REPLIES 6

TryciaK
Tera Contributor

The issue of an empty user record being inserted into the User (sys_user) table when creating an incident through the API typically stems from how ServiceNow handles reference fields like the Caller field.

So is that means even the account we are using to create incident through API don't have access to user table will still insert record?

 

Ankur Bawiskar
Tera Patron
Tera Patron

@mayankkhurana 

which API is being used? please share some details and screenshots.

If you are using Table API then this should not happen

If you are using Import Set API then check the field mapping for caller field, you must have kept Choice action as Create

It should be marked as Reject/Ignore

AnkurBawiskar_0-1750415682037.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

I am hitting the table API of Incident, and in the payload lets say if I pass the caller ID which is wrong sys_id of user in that case it is automatically inserting an empty user Record, the user account we are using to create the Incident through API only have incident_read & incident _write role