Creating and updating tickets

Have more questions? Submit a request

11 Comments

  • Anais
    Comment actions Permalink

    Hi Darren, thanks for this article.

    I managed to add collaborators using dynamic contents (depends on a ticket field value) and the url target: api/v2/tickets/{{ticket.id}}.json+?ticket[additional_ collaborators]={{dc.xxx}}.

    Now I would like to use emai_ccs, so I replaced additional_ collaborators in my URL by emai_ccs, but it doesn't work. Any idea why ?

    0
  • Alex Short
    Comment actions Permalink

    Hi Zendesk - 

    Can we please have the understanding of how to do the below? 

    1. A user(our client)  does some action in our website. (e.g: filling a form) and we have their email address in our database. Note that user does not send any email to anybody. He/she just clicks on a button or fills a form.

    2. Our backend calls Zendesk API

    3. Zendesk should create a ticket , in a way that it seems our client has created this ticket (the ticket should be ready to be replied to the email of our client)

     

    Is this possible? Thank you

    0
  • Sydney Frederick-Osborn
    Comment actions Permalink

    What about non-email requests - if we want to use SMS, how can we specify a customer address as a phone number?

    0
  • CCDEV
    Comment actions Permalink

    hi, 

    I have been using the request API which allowed end users to create requests, is it possible for request API also Setting custom field values like this article mentioned? "

    "custom_fields": [{"id": 25356634, "value": "2020-02-24"}, ...]

    "

    thank you

    0
  • Chee Lee
    Comment actions Permalink

    Hi,

    Would it be possible to run an If statement condition where a ticket contains a certain subject then update the ticket to a requester? I have the script below, but does not work.

    {

    "if": {
    "subject": {
    "#18887680692#": {
    }
    },
    "required": [
    "#18887680692#"
    ]
    },
    "then": {
    "required": [
    {"ticket": {"requester": {"requester_id": "369091516553", "email": "xxx@mydomain.com"}}}
    ]
    },
    "else": false
    }

    Any advice would be appreciated.

    Thank you,

    Chee

    0
  • McCabe Tonna
    Comment actions Permalink

    Chee Lee

     

    I'm not sure I'll be able to get this on the first time; but why not use a trigger to only run when the condition is met?

    Your HTTP Target should look like this:

    https://YOURZENDESK.zendesk.com/api/v2/tickets/{{ticket.id}}.json

    >PUT

    >JSON

     

    Also note that you might want to hard code the requester_id.

    Let me know how this goes 

    0
  • JJ
    Comment actions Permalink

    Hello CCDEV,

    Yes.

    Using custom ticket fields in the Request API is possible.

    For more info:

    REST API: Requests
    REST API: Setting custom field values

    Have a great day and stay safe!

    0
  • John Kennedy
    Comment actions Permalink

    Hi Darren,

    Thank you for this post, it is very helpful. I have successfully called this api with a new requester included. I have found that if the requester is a user already it works. If they are not in our system, then we get a phone record validation error. The JSON we are submitting and the error are below. Any help would be much appreciated.

    Thanks,

    John

    JSON submitted.

    {
    "ticket": {
    "comment": {
    "body": "He was checking in on her delivery status.",
    "public": false
    },
    "priority": "urgent",
    "requester": {
    "locale_id": 1,
    "name": "John Test",
    "email": "test@gmail.com",
    "phone": "5553157111"
    },
    "subject": "Support call from John Test",
    "type": "incident",
    "via": {
    "channel": "teams"
    }
    }
    }

    Error in Response.

    {
      "error": "RecordInvalid",
      "description": "Record validation errors",
      "details": {
        "requester": [
          {
            "description": "Requester: Phone 9038832781 is not properly formatted. A valid international E.164 phone number must include a country code, usually an area code, and a subscriber number. For example, +1 (555) 123-4567."
          }
        ]
      }
    }
    0
  • McCabe Tonna
    Comment actions Permalink

    @John Kennedy

    The error response is from https://developer.zendesk.com/rest_api/docs/support/users#phone-number

    specifically the phone number should look like "phone": "15553157111" vs 5553157111.

    I'm curious the response when you change to this phone format.

     

    0
  • John Kennedy
    Comment actions Permalink

    McCabe Tonna

    Thank you for the quick response!

    I tried it and it works. It appears if the user exists it does not check the phone format and creates the ticket. If the user does not exist, then it makes the check on the requester data and fails if the phone format is not correct. That solves it. 

    Thank you!

    John

    0
  • McCabe Tonna
    Comment actions Permalink

    Great, glad we figured it out. 

    0

Please sign in to leave a comment.

Powered by Zendesk