/build/static/layout/Breadcrumb_cap_w.png

Insert dynamic comment from custom rule

I'm trying to figure out if it is possible to insert a comment with the result of a SQL query. It appears that the built in "Append comment to ticket" option is just a static/stagnate field that just dumps what's in the box into a comment. What I need is a way for adding a more dynamic comment. For instance:

  1. I have a drop down menu assigned to Custom Field 1.
  2. On ticket save, a custom rule checks if there is now data in Custom Field 1.
  3. If data is there, run update query to add a comment with the results of Custom Field 1 and then reset the field to blank.

Is it possible to add that kind of comment during the update query?


Thanks!!


5 Comments   [ + ] Show comments
  • Hi Techman D,

    I've been looking into the best way to do this. Long story short, I can't get it to work the way you want. I'm not sure how much you have dug into this, but:
    Using the Wizard as a starting point, we can very easily accomplish the "On ticket save": if Custom Field 1 != "", then set Custom Field 1 = "".

    This gives us the SQL that we need.

    The issue is that the "Append comment" does not expose the variables. Variables appear to only be exposed on the "Email each recipient in query results".

    Would using an email notification be helpful to you?

    I'll keep digging on this, as I am unsure of the limitations of using the Update SQL (as now I'm curious myself).

    Let me know if this helps or if you figure it out. - aarmington 5 years ago
  • Hey aarmington,

    Thank you for looking into this. I have a separate rule that works properly checking a custom field, sending an email using variables, and then clearing the field.

    The comment is the hang up. I would like to have a comment added with the specifics of that custom field. I, too, found that the variables seem to only be exposed to the email section and I have found nothing that explains a way to work around this.

    A little more information:
    I am trying to create field that would allow an owner to select a knowledge base article from a drop down. I know there is already an option for that built in, but it dumps the plain text from the KB into the comment. This is useless for KBs that are written in markdown that have numbered steps or pictures. To drive more traffic to the KB article itself (increasing views and maybe ratings), I created the field with the hopes of writing a rule that would check if a KB was selected in the custom field, and then providing a URL to the article in a comment.

    My workplace uses the comment field for documentation purposes. Every step, communication, update from vendor, all of it is tracked in the comments. Having the flexibility to use the comment field, I would imagine, would be beneficial in other circumstances. - Techman D 5 years ago
  • Hi Techman,

    I've been looking into this. I think it can be done in a roundabout way, but it's going to involve some SQL and various ticket rules. Hilariously enough, I am now interested in implementing this myself. This is a rather interesting shortfall in the current system. I'll keep you updated if I make any breakthroughs on this. - aarmington 5 years ago
  • Hey aarmington,

    That's awesome! Yea, I don't know why it isn't an option already. Seems a little silly. There is a request for more flexibility with the comments in ticket rules on UserVoice so, anyone interested, please vote:
    https://kace.uservoice.com/forums/82699-sma-k1000/suggestions/8066940-allow-ticket-rules-to-insert-sql-variables-varia

    Thank you again! - Techman D 5 years ago
  • I came across this trying to do the same thing. I wanted to add a comment when a request was approved stating that it was approved and the name of the approver so that I did not have to got to history to see who approved. What is even more interesting is there is status update email showing the comment and it has the name in it even though the comment only has the variable! - donnabomb 5 years ago

Answers (0)

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