3 Comments

  • Joey
    Comment actions Permalink

    Hi Aleksey-

    Great question, although at this time there is no way to retrieve only custom fields using our REST API.

    0
  • Rishi Sheth
    Comment actions Permalink

    We have been calling `GET /api/v2/tickets/{ticket.id}.json` with the client.request call, and using a function like this to get custom fields:

    `ticket` is the ticket object we are building.
    `ticketFields` is the object returned from that above API call.

    1
  • Bristlecone
    Comment actions Permalink

    Hi,

    We are trying to get metadata of Ticket object using the GET: api/v2/ticket_fields API. The API returns an array of JSON objects, wherein an object contains the details of a ticket field.

    Since POST:api/v2/tickets requires custom field's data to be sent in the following format:-

    { "ticket": { "custom_fiellds":[ {"id":"custom_field_id","value":"data"}] }} 

    we need to identify the custom fields in the metadata. However, we cannot find any property in the metadata that distinguishes a standard field from custom.

    Q1:
    How do we achieve this?

    Q2: In case of Users the API : GET /api/v2/user_fields returns only custom fields. Is there any API for Tickets that returns only custom fields?

    Q3: We found that a custom field can have only following data types at present. So can we rely on this fact that if a field has any of the following data type, then it is a custom field?

    text
    textarea
    textarea
    dropdown
    regexp
    date
    integer
    decimal
    checkbox

    0

Please sign in to leave a comment.

Powered by Zendesk