How do I stop K1000 from emailing every time a ticket changes?
We currently have custom ticket rules set up so if a user selects a particular location, an email will be generated and sent to the technician in that building. The email comes through, but now every time a change is made to a ticket and save is clicked, the custom ticket rule generates an email and sends it to the technician. I really only need one email to be sent when the ticket is generated. Can this be done with a custom rule in place?
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
Falejandre
9 years ago
I followed the instructions listed on dells site https://support.software.dell.com/kb/111222 and was able to create a rule for each of my Employees to be notified that a ticket has been created. I no longer use Emails and Events. That feature over emails you.
Comments:
-
Actually I did use this rule and I like it better then mine, but I could never figure out how to have it apply per technician when a person selects a particular building. I can use it if I wanted to just email the entire IT group. Everyone would get an email and the technician could just go in a get theirs, but there was concern some tickets might get lost in the mix. - mjreccoppa 9 years ago
-
For something like this you need to have a separate rule per building/technician. If you want to get fancy you could utilize the assets module and link tickets to a location asset. If you assign technicians to those assets you could have KACE lookup the appropriate technician in the database and email them. That's obviously much more complicated but is certainly possible. - chucksteel 9 years ago
-
Actually this sounds interesting. Can this be done with the instructions in the kb article? - mjreccoppa 9 years ago
-
The KB article requires hardcoding the email address of the recipient in the rule. It isn't dynamic. You could use case statements to set the recipient based on location also. - chucksteel 9 years ago
-
I wanted to look into this a bit more. I have the assets set up by location, but I'm not sure how to assign a technician to those assets. You go to Assets, select Assets and choose the location i'm guessing? And then you link the assets to the tickets? - mjreccoppa 9 years ago
-
You need to add a field to the Location asset to store the technician email address. Once that is done you can get the technician's email address based on the location selected in the ticket. The ticket custom field should also get its values from the asset table using a query, that way it matches exactly. - chucksteel 9 years ago
Posted by:
chucksteel
9 years ago
Rather than use a rule that just looks for tickets with the custom field set, you want to detect a change in the custom field. This is tracked in the HD_TICKET_CHANGE_FIELD so you will need to create a join to that table looking for changes in the CUSTOM_FIELD_VALUE2 field. Find this line in your current select statement:
LEFT JOIN MACHINE M1 on M1.ID = HD_TICKET.MACHINE_ID
Directly below it add this line:
JOIN HD_TICKET_CHANGE_FIELD ON HD_TICKET_CHANGE_FIELD.HD_TICKET_CHANGE_ID=<CHANGE_ID>
and HD_TICKET_CHANGE_FIELD.FIELD_CHANGED='CUSTOM_FIELD_VALUE2'
Now you can look for tickets where the building has changed to either Samsel or Board. Instead of these statements:
HD_TICKET.CUSTOM_FIELD_VALUE2 like '%Samsel%') OR HD_TICKET.CUSTOM_FIELD_VALUE2 like '%Board%'
Use this:
HD_TICKET_CHANGE_FIELD.AFTER_VALUE = "Samsel" OR HD_TICKET_CHANGE_FIELD.AFTER_VALUE = "Board"
Comments:
-
When adding the field to the asset, would that be user or text and just type in the email? I think user might be wrong because technically they aren't the user. - mjreccoppa 9 years ago
-
In terms of making the rule simplest I would add a text field that contains the technician email address. - chucksteel 9 years ago
-
Ok,..I think I got that down. Can you use the wizard to create a custom ticket with this? I tried and I didn't see a way to map it. I checked the config manual but it didn't seem to be a lot of help. - mjreccoppa 9 years ago
-
The next step is to have your custom field reference the location asset. You do this by specifying that the type is a select field and the values are:
query:SELECT NAME FROM ASSET WHERE ASSET_TYPE_ID = 1 ORDER BY ASSET.NAME ASC
This assumes that the location has an asset_type_id of 1. This will populate the custom field with the locations in the asset module. Once you have done that you need to modify the ticket rule to join to the asset table and then to the asset_data_1 table to get the value of the field you added to the location asset type. This gets a little more complicated and the column names will be unique to your KBox. - chucksteel 9 years ago
Posted by:
chucksteel
9 years ago
Yes, you should be able to craft your custom rule to only run once. Can you post the select statement for your rule?
Comments:
-
Here you go..
select HD_TICKET.*,
HD_STATUS.NAME AS STATUS_NAME,
HD_STATUS.ORDINAL as STATUS_ORDINAL,
HD_IMPACT.ORDINAL as IMPACT_ORDINAL,
HD_CATEGORY.ORDINAL as CATEGORY_ORDINAL,
HD_PRIORITY.ORDINAL as PRIORITY_NUMBER,
HD_TICKET.ID, -- $id
HD_TICKET.ID AS TICKNUM, -- $ticknum
HD_TICKET.TITLE, -- $title
HD_TICKET.SUMMARY, -- $summary
HD_CATEGORY.NAME as CATEGORY,
HD_PRIORITY.NAME as PRIORITY,
HD_STATUS.NAME as STATUS,
DATE_FORMAT(HD_TICKET.CREATED,'%b %d %Y %I:%i:%s %p') as CREATED,
DATE_FORMAT(HD_TICKET.MODIFIED,'%b %d %Y %I:%i:%s %p') as MODIFIED,
'xxxxxxxx@xxx.net' as TECHNICIAN_EMAIL,
STATE,
if(M1.ID is null, 'z', concat('a', M1.NAME)) as sort_MACHINE_NAME,
if((datediff(DUE_DATE, now()) = 0), 2, if((datediff(DUE_DATE, now())<0), 1, 3)) as SORT_OVERDUE_STATUS,
if(unix_timestamp(TIME_OPENED) > 0, TIME_OPENED, 1<<62) as SORT_TIME_OPENED,
if(unix_timestamp(TIME_STALLED) > 0, TIME_STALLED, 1<<62) as SORT_TIME_STALLED,
if(unix_timestamp(TIME_CLOSED) > 0, TIME_CLOSED, 1<<62) as SORT_TIME_CLOSED,
if(unix_timestamp(ESCALATED) > 0, ESCALATED, 1<<62) as SORT_ESCALATED,
if(unix_timestamp(HD_TICKET.CREATED) > 0, HD_TICKET.CREATED, 1<<62) as SORT_TIME_CREATED,
if(unix_timestamp(HD_TICKET.MODIFIED) > 0, HD_TICKET.MODIFIED, 1<<62) as SORT_MODIFIED,
if(unix_timestamp(HD_TICKET.DUE_DATE) > 0, HD_TICKET.DUE_DATE, 1<<62) as SORT_DUE_DATE,
case upper(STATE)
when 'CLOSED' then unix_timestamp(HD_TICKET.TIME_CLOSED) - unix_timestamp(HD_TICKET.TIME_OPENED)
when 'OPENED' then unix_timestamp(NOW()) - unix_timestamp(HD_TICKET.TIME_OPENED)
else unix_timestamp(NOW()) - unix_timestamp(HD_TICKET.CREATED) end as AGE,
if ((LENGTH(U1.FULL_NAME) = 0), U1.USER_NAME, U1.FULL_NAME) as OWNER_NAME,
U1.FULL_NAME as OWNER_FULLNAME,
U1.EMAIL as OWNER_EMAIL,
if (U1.ID is null, 'z', concat('a', if ((LENGTH(U1.FULL_NAME) = 0), U1.USER_NAME, U1.FULL_NAME))) as SORT_OWNER_NAME,
if ((LENGTH(U2.FULL_NAME) = 0), U2.USER_NAME, U2.FULL_NAME) as SUBMITTER_NAME,
U2.FULL_NAME as SUBMITTER_FULLNAME,
U2.EMAIL as SUBMITTER_EMAIL,
if (U2.ID is null, 'z', concat('a', if ((LENGTH(U2.FULL_NAME) = 0), U2.USER_NAME, U2.FULL_NAME))) as SORT_SUBMITTER_NAME,
if (U3.ID is null, 'z', concat('a', if ((LENGTH(U3.FULL_NAME) = 0), U3.USER_NAME, U3.FULL_NAME))) as SORT_APPROVER_NAME,
if(APPROVAL='rejected', 'Rejected', if(APPROVAL='info', 'More Info Needed', if(APPROVAL='approved', 'Approved', if(APPROVER_ID>0, 'Pending', '')))) as APPROVAL_STATUS,
Q.NAME as QUEUE_NAME
from (HD_TICKET, HD_PRIORITY, HD_STATUS, HD_IMPACT, HD_CATEGORY)
LEFT JOIN USER U1 on U1.ID = HD_TICKET.OWNER_ID
LEFT JOIN USER U2 on U2.ID = HD_TICKET.SUBMITTER_ID
LEFT JOIN USER U3 on U3.ID = HD_TICKET.APPROVER_ID
LEFT JOIN HD_QUEUE Q on Q.ID = HD_TICKET.HD_QUEUE_ID
LEFT JOIN MACHINE M1 on M1.ID = HD_TICKET.MACHINE_ID
where HD_PRIORITY.ID = HD_PRIORITY_ID
and HD_STATUS.ID = HD_STATUS_ID
and HD_IMPACT.ID = HD_IMPACT_ID
and HD_CATEGORY.ID = HD_CATEGORY_ID
and ((( HD_TICKET.CUSTOM_FIELD_VALUE2 like '%Samsel%') OR HD_TICKET.CUSTOM_FIELD_VALUE2 like '%Board%') and HD_TICKET.HD_QUEUE_ID = 27 ) - mjreccoppa 9 years ago