Question about Custom Object Capabilities -- How to Model a Picklist/Enum

8 Comments

  • Ahmed Zaid
    Community Moderator

    I second the author. Custom object schema is supposed to support properties restriction as documented here. Unfortunately, this is not the case and the api reference shows lack of support for validation.

    2
  • Eric Nelson
    Zendesk Developer Advocacy

    Hey  Jena Miller,

    Can you provide a copy of your request for me to take a look at? Let me know if you'd like to pull this into a ticket.

    Thanks!

    0
  • Jena Miller

    Hey Eric Nelson

    Thanks for following up!  I did submit a ticket already and was directed to this community instead.  Unfortunately, given the lack of response I have chosen to move forward with a different product's toolset so no need for further triage.

    Thanks. 

    0
  • Eric Nelson
    Zendesk Developer Advocacy
    Hey D2iQ,

    Sorry to hear about your less than ideal experience. We're a pretty small team that covers the community so it sometimes takes us a bit to get to every post. 

    Let us know if you need anything,
    0
  • Ahmed Zaid
    Community Moderator

    Hi Eric Nelson,

    I am experiencing the same issue as D2iQ. Allow me explain further:

    The documentation here clearly states the possibility to restrict a property to a fixed set of values while creating a custom object schema. It also lists other validation features.

    On the contrary, the API reference here explains that keywords for validation such as "enum" are not supported in the schema. Which means that all the validation features listed in the documentation are not actually supported except for the "type".

    Here is an example request that follows the documentation:

    curl https://{subdomain}.zendesk.com/api/sunshine/objects/types \ 
    -d { "data": { "key": "my_key", "schema": { "properties": { "my_property": { "type": "string", "enum": ["my_option_1", "my_option_2"] } } } } } \

    -H "Content-Type: application/json" -X POST
    -v -u {email_address}:{password}

    And here is the response:

    {
       "errors": [
           {
               "code": "BadRequest",
               "status": "400",
               "title": "Bad Request",
               "detail": "data.schema object instance has properties which are not allowed by the schema: [\"enum\"]"
           }
       ]
    }

     

    0
  • Eric Nelson
    Zendesk Developer Advocacy
    Hey Ahmed,

    That's very odd! I've been able to replicate this issue on my side. I've looped in the product team who owns custom objects to assist me with digging into this. I'll touch base as soon as we've tracked down the issue.

    Thanks for your patience!
    1
  • Ashwin Raju
    Zendesk Product Manager

    Hey Ahmed.. Unfortunately, we don't support enum. But thank you for calling out the discrepancy in documentation. I will get that updated. But the good news is that, we are working on a newer version of custom objects, which will include all the field types that a User or an Organization supports today. And will also work seamlessly with other Zendesk products like Triggers, Tickets etc. We intend to release this new version in the first half of next year. 

    1
  • Ahmed Zaid
    Community Moderator

    That's great news. Thanks Ashwin Raju for the update.

    0

Please sign in to leave a comment.

Powered by Zendesk