/build/static/layout/Breadcrumb_cap_w.png

Write Ticket Values as a Comment

I have several ticket queues setup for different departments.  I also have some rules that automatically move a ticket from one queue to the other based on certain conditions.
I'm looking for a method to write the value of a custom field as a comment.  I was hoping by defining the custom field in the select statement I could then use that variable in the "Append comment to ticket" the same way I would when sending emails.  However either I'm doing something wrong or that's not supported.

For example
         SELECT
      -- ticket fields
HD_TICKET.CUSTOM_FIELD_VALUE6 AS SETUP_NAME, -- $setup_name
HD_TICKET.CUSTOM_FIELD_VALUE3 AS NMLS_NAME, -- $nmls_name
HD_TICKET.CUSTOM_FIELD_VALUE0 as BRANCH_NAME, -- $branch_name
HD_TICKET.CUSTOM_FIELD_VALUE1 as JOB_TITLE, -- $job_title

If I try to use $setup_name in the "Append comment to ticket" it simply displays as "$setup_name" whereas if I use that in building an email it shows the field value.

Has anybody done this, I'm assuming I will need to do this as an update query.  If anybody has an example on how to make this work that would be great.


2 Comments   [ + ] Show comments
  • Looks like you're going to need an update query. Updating into the comments can be a tricky thing. I've found that you actually have to write into two fields. You have to write/update into the HD_TICKET_CHANGE.COMMENT field (which is the 'comment') and then also into the HD_TICKET_CHANGE.COMMENT_LOC field (which holds the actual, visible comment. It has a standard format of: sprintf(_(stripslashes('')), '');

    With a comment inside it looks like; sprintf(_(stripslashes('update')), '');


    So, that being out there, you would need the update query to append to those 2 fields without breaking the formatting.

    You'd need a concat that circumvents all that beginning formatting (which is static) (or just write it into the update statically) and then append the comment.

    something like:
    update HD_TICKET_CHANGE,
    HD_TICKET_CHANGE.COMMENT = HD_TICKET.CUSTOM_FIELD_VALUE1,
    HD_TICKET_CHANGE.COMMENT_LOC = sprintf(_(splitslashes'HD_TICKET.CUSTOM_FIELD_VALUE1)), '') WHERE (HD_TICKET_CHANGE.HD_TICKET_ID in (<TICKET_IDS>))

    That MIGHT work? Give it a shot and play with that update logic? - Wildwolfay 10 years ago
  • Just wondering if you ever found out a way to do this? I'm trying to do the same thing, but with copying the Resolution as a comment :( - yunowork 9 years ago

Answers (0)

Be the first to answer this question

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ