Error when I am trying to open a new ticket on 'Behalf of a user' | Community
Skip to main content

Error when I am trying to open a new ticket on 'Behalf of a user'

  • December 9, 2021
  • 2 replies
  • 0 views

Jeb

When I make the call as myself it works fine. But when I a new request on behalf of them it is giving me an error.

For example:

POST: https://thiswayglobal.zendesk.com/api/v2/requests.json

{ "request": { "subject": "Help!",
"comment": {
"body": "My printer is on fire!",
"type": "Comment"
},
"priority": "normal",
"type": "incident",
"status": "open" }
 

Works fine for opening my own ticket. When I add the following to the header:

"X-On-Behalf-Of","tomjones.example.com"

I get the following error:

{
"error": "RecordInvalid",
"description": "Record validation errors",
"details": {
"base": [ { "description": "Type: cannot be blank",
"error": "BlankValue",
"field_key": 360040711652 } ] } }
 
The issue is that I am creating a REQUEST and not a TICKET and in the documentation for requests says to 
"Read-only first comment on the request. When creating a request, use comment to set the description"
 
 
I'm also using the exact form in the documentation. Can you please help? 

2 replies

Jeb
  • Author
  • December 17, 2021

I figured out what the issue is just in case someone encounters the same thing. It turns out that one of our Zendesk admins had created a new custom field and called it 'Type' (the worst name to use of all time). On top of that it was required and set to a mult select type with no 'values' given.

So this error was created by our own team. Sigh


  • December 17, 2021
Hey Jeb!
 
Thank you so much for posting in the Community! I'm glad your team was able to resolve this. Also, thanks for following up on the post and sharing your solution. I know we can all relate when it comes to naming convention mishaps and I'm sure this will be a useful tip for many. 
 
Hope you have a great weekend! 
 
Best,
 
Erica - Dev Support