Getting the Macros to copy from the ticket public reply to add to the comment

Answered

4 Comments

  • Andrew J
    Comment actions Permalink

    Can you give a bit more detail? It's a bit hard to figure what you are trying to do.

    Are you trying to extract previous comments and notes into another comment?

    0
  • sherif hatem
    Comment actions Permalink

    Exactly , like accumulating previous comments into one comment  

    0
  • Andrew J
    Comment actions Permalink

    Hello Sherif, that cannot be done with macros. I'm thinking you might be able to trigger this using a (unsupported) method.  Depending how you want to trigger this you would swap this example around a bit.

    Use trigger to fire a target updating the ticket via http target for a private comment (possibly trigger to fire on update if a certain tag is present - which you could add with a macro - don't forget to have the trigger REMOVE the tag to prevent refiring).

    Trigger can then send all comments, or public comments etc and should add a new comment with this info.

    Should be interested to set up - enjoy!

    For instructions on updating the ticket via trigger/target have a look at the below. Quoting from COlin here https://support.zendesk.com/hc/en-us/community/posts/207593618-Trigger-firing-2-URL-targets-not-working-consistently

     

    Setting up an http target:

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

    Method: PUT

    Content Type: JSON

    Then add your api authentication

    Using the notification in a trigger is just a case of using the api. Perhaps some examples will inspire you.

    {"ticket": {"recipient": "accounts@domain.com", "custom_fields" : [{"id":19713728, "value": true}]}}

    In this example I set two fields on the "ticket" object. The first is the Recipient field which is not available through they UI. The second is a custom dropdown field. You can add as many pairs (field name, field value) as you wish to the JSON statement.

    Here is another example:

    {"ticket": {"comment": {"public": false, "body": "Ticket escalated to the Accounts group by {{current_user.name}}\nType of Issue: {{ticket.ticket_field_option_title_11818801}}"}}}

    In this example I add a private comment to a ticket using placeholders also.

    1
  • Graeme Carmichael
    Comment actions Permalink

    You can use liquid markup to consolidate previous comments.

    {% for comment in ticket.comments %}

    {{comment.value_rich}}

    {% endfor %}

    Although, you may have to play to get the formatting correct.

    1

Please sign in to leave a comment.

Powered by Zendesk