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



  • Andrew J. Mills
    Community Moderator

    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?

  • sherif hatem

    Exactly , like accumulating previous comments into one comment  

  • Andrew J. Mills
    Community Moderator

    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


    Setting up an http target:


    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": "", "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 {{}}\nType of Issue: {{ticket.ticket_field_option_title_11818801}}"}}}

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

  • Graeme Carmichael
    Community Moderator

    You can use liquid markup to consolidate previous comments.

    {% for comment in ticket.comments %}


    {% endfor %}

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


Please sign in to leave a comment.

Powered by Zendesk