E-mail every member of a queue on new ticket creation
Hi everyone, I am trying to create a custom rule that will e-mail every member of a queue when a new ticket is created (whether it's assigned or not) so that if someone happens to be out of the office, the other members know that a ticket was assigned to that person so they can work the ticket if available.
We have a group e-mail that includes all members so I would e-mail to networksupport@mycompany.com when a ticket is opened for a specific queue.
I have been reading some other posts and looks like I might need to know the queue number since I have multiple queues but I am not sure how to find that information.
Thanks in advance
Answers (4)
Comments:
-
I have tried this and received an error.... Please forgive my ignorance as I do not know SQL so I am kind of browsing through the query trying to figure out everything it does. Do I just need to change the url for my k1000 appliance or is there anything else I am supposed to change?
Here is the error I am seeing when using your SQL above:
02/24/2015 16:00:02> Starting: 02/24/2015 16:00:02 02/24/2015 16:00:02> Executing Select Query... 02/24/2015 16:00:02> mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=<CHANGE_ID> /* complete history*/ JOIN HD_TICKET_CHANGE H ON H.HD_TICKET_' at line 81] in EXECUTE("SELECT -- ticket fields HD_TICKET.ID, -- $id HD_TICKET.ID AS TICKNUM, -- $ticknum HD_TICKET.TITLE, -- $title DATE_FORMAT(HD_TICKET.CREATED,'%b %d %Y %I:%i:%s %p') AS CREATED, -- $created DATE_FORMAT(HD_TICKET.MODIFIED,'%b %d %Y %I:%i:%s %p') AS MODIFIED, -- $modified -- change fields C.COMMENT, -- $comment C.DESCRIPTION, -- $description GROUP_CONCAT(CONCAT('----- Change by ', UPDATER.EMAIL,' at ',H.TIMESTAMP,' -----\n', H.DESCRIPTION,'\n',H.COMMENT,'\n\nPlease see your ticket at .... - raul102801 9 years ago-
Change all the things that are in bold in the query. That would be the k1000 website and the distributionemail. Make sure you don't include the bottom part of the text starting with "Then Email each ..." That is a separate config you need to do. - h2opolo25 9 years ago
-
Thanks for the response... I did only change the bold kboxwebsite for the url of my k1000 and distribution list with the e-mail address that covers the whole group of people and made sure that I only copied and pasted the parts from the beginning to "Having 1=1" and I still get an error on the same line:
/* latest change ***/ JOIN HD_TICKET_CHANGE C ON C.HD_TICKET_ID = HD_TICKET.ID AND C.ID=<CHANGE_ID>
I am thinking that is the line based on the error message:
02/26/2015 10:43:22> Starting: 02/26/2015 10:43:22 02/26/2015 10:43:22> Executing Select Query... 02/26/2015 10:43:22> mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=<CHANGE_ID> /* complete history*/ JOIN HD_TICKET_CHANGE H ON H.HD_TICKET_' at line 79] in EXECUTE("SELECT -- ticket fields HD_TICKET.ID, -- $id HD_TICKET.ID AS TICKNUM, -- $ticknum HD_TICKET.TITLE, -- $title DATE_FORMAT(HD_TICKET.CREATED,'%b %d %Y %I:%i:%s %p') AS CREATED, -- $created DATE_FORMAT(HD_TICKET.MODIFIED,'%b %d %Y %I:%i:%s %p') AS MODIFIED, -- $modified -- change fields C.COMMENT, -- $comment C.DESCRIPTION, -- $description GROUP_CONCAT(CONCAT('----- Change by ', UPDATER.EMAIL,' at ',H.TIMESTAMP,' -----\n',
Since the script worked for hutcha4113 I am guessing I might be doing something wrong but the instructions you gave are pretty straight forward so I don't know what I could be doing wrong. I just copied your script and pasted into notepad ++ replaced kboxwebsite with k1000@mycompany.com and replaced Distribution Email with networksupport@mycompany.com and then used the second part of your script to create the Message to be sent to the techs that are part of the group.
Any ideas as to why this might be failing? - raul102801 9 years ago
-
Thanks. This script is exactly what I was looking for. Works like a charm. - hutcha4113 9 years ago
-
hutcha4113 did you have to do anything special or just copy and paste and modify the kbox url and the distribution e-mail? I am having issues with it but I don't know if it is something I am doing or if this has to do with my version of the k1000 of what..... I am using 6.2.109330 - raul102801 9 years ago
-
Just cut/paste, edit the bold fields. When the rule runs, you should see it in the log of the rule - it should tell you there why it is failing.
So in the configuration of the rule you should have:
1) In the first box where it says SELECT SQL everything from the Select statement to the end where is says Having 1=1.
2) Checkmark in "Email each recipient in query results"
3) In "Subject" box [TICK:$ticknum] NEW TICKET: $title.
4) In "Column containing email address" NEWTICKETEMAIL (which is part of the Select statement code above.
5) In "Message" - whatever you want...but this is what I have. $submitter_fname has opened a ticket.
The submission was:
Ticket: $ticknum
From: $submitter_fname ($submitter_email)
Category: $category
Priority: $priority
Status: $status
Severity: $impact
Opening Comment: $comment
For more details go to:
http://MYKBOX/adminui/ticket?ID=$id
(I am going to the AdminUI, rather than UserUI as that is where the staff work).
I am running version 6.3 - so what you mentioned is possible. I don't know SQL code so cannot answer that one.
Everytime the rule runs, there is a log "Last Run Log". That should tell you what is happening, both good and bad.
5 - hutcha4113 9 years ago
-
Thanks for the detailed explanation hutcha4113... This looks exactly like what I have done in every step. I did look at the log which is where the error message I pasted above is coming from but I don't know SQL either so I am not really sure what it is that is saying is wrong on the mentioned line.... I'll keep trying to figure it out. Thanks again - raul102801 9 years ago
-
Oups..sorry...just saw that you posted the error. If I knew SQL I would help - but anything I would post is not useful....lol. I generally involve my SQL guy when I run into issues on this. Even though he is MS SQL, and this is MY SQL the general principals are the same, so he fixes it for me.
You may be correct on the version. I did not try this script until the date posted - which is after we had upgraded to 6.3 - hutcha4113 9 years ago
Thanks for the suggestions Chris. I copied and pasted your statements and this is what I get when I choose the run now option:
02/23/2015 11:09:12> Starting: 02/23/2015 11:09:12 02/23/2015 11:09:12> Executing Select Query... 02/23/2015 11:09:12> mysql error: [1146: Table 'ORG1.HD_Ticket' doesn't exist] in EXECUTE("SELECT HD_Ticket.*, HD_Status.Name as STATUS_NAME FROM HD_Ticket WHERE STATUS_NAME = "New"")
Would I have to add a line somewhere specifying the queue ID I want to run this in?
Thanks