How to determine if the ticket is updated or not ?

6 Comments

  • Sebastiaan Wijchers
    Comment actions Permalink

    Hello Olivier,

    As you're using the save hook, I guess you're using the ticket_sidebar (or ticket_editor) location for your app. In that case you can use:

    client.get('comment.text')

    https://developer.zendesk.com/apps/docs/support-api/ticket_sidebar#comment.text

    To get the text that has been filled in the comment field. With the returned value you can determine if a new comment will be added or not.

    Be cautious, as an empty comment will still return:

    <p></p>

    With kind regards,

    Sebastiaan
    Sparkly ⭐

     

    0
  • Olivier GUITER
    Comment actions Permalink

    Thanks Sebaastian for your help.
    Up to now, i m using "ticket.saved" event on a background app. The event is fired when agent press the "save" button eventhough there's no change at all in the ticket..and there's no specific field in the object which can help to do the check.

    What i want to do is: When adding a comment on ticket A, i would like to copy it to Ticket B ... (seems easy no ? :))

    With kind regards, 

    Olivier

    0
  • Sebastiaan Wijchers
    Comment actions Permalink

    Hello Olivier,

    I just checked `ticket.saved` from the `background` location and it seems you are right. The ticket comment is always <p></p> there, whether a comment has been added or not.

    So you could try to add a ticket_sidebar location to your app, that communicates with the background location?

    With kind regards,

    Sebastiaan
    Sparkly ⭐

    0
  • Olivier GUITER
    Comment actions Permalink

    Hello Sebastiaan,

    Following your 1st advice, i switched to "ticket.save" event handling... and, after fixing my "Promise Pending" issues :), everything seems to work !
    Thanks again for your help !
    Cheers,

    Olivier

    0
  • Sebastiaan Wijchers
    Comment actions Permalink

    That's good to hear and you're welcome!

    0
  • Devan
    Comment actions Permalink


    Hello everyone,

    On Tuesday, November 5th, from 10:00am-12:00pm CST, we'll have a special guest team of experts on hand to answer your questions about Zendesk Apps Framework (ZAF) in your Zendesk Developer instance for an AMA-style conversation!

    Just click the "new post" button and write up your question. Be sure to be as detailed as possible. The best questions include: 

    • What it is you're trying to do
    • What you've tried so far 
    • Any other context or relevant information
    • Screenshots, if you have them

    Questions posted to this topic in advance of the start time will be answered first thing on the 5th, so if you've got something you want our experts to look at.

    0

Please sign in to leave a comment.

Powered by Zendesk