/build/static/layout/Breadcrumb_cap_w.png

Ticket Rule and Labels

Question about using labels with ticket rules...

Is there a way to define a rule based on a label? For example, if submitter is in the "VIP" label, then change the priority of the ticket to high. I know I can make individual VIP rules, but I'd like to have it based on the label and then manager which folks are labeled "VIP".

I'd also like to have a ticket rule that would change the ticket based on the machine label of the submitter.

Thanks for any help!

John Garcia
FPG Child Development Institute
University of North Carolina at Chapel Hill

0 Comments   [ + ] Show comments

Answers (2)

Posted by: GillySpy 12 years ago
7th Degree Black Belt
4
a very basic rules that would keep the priority high when the submitter is a VIP at all times a ticket is changed would look like this:

frequency=on ticket save
/*********select query: *******/
select HD_TICKET.ID
from HD_TICKET JOIN
USER SUBMITTER ON SUBMITTER.ID=SUBMITTER_ID
JOIN USER_LABEL_JT SL ON SL.USER_ID=SUBMITTER_ID
JOIN LABEL L ON L.ID=SL.LABEL_ID
WHERE
L.NAME='VIP'
and <CHANGE_ID> > 0

/******* update query **********/
update HD_TICKET T JOIN HD_STATUS S ON S.HD_QUEUE_ID=T.HD_QUEUE_ID and S.NAME='High'
SET
HD_STATUS_ID=S.ID
WHERE
T.ID =<TICKET_IDS>


Note: i only tested this for syntax errors, but it looks good

If it was my rule i would be checking to see if the status actually changed and leaving an audit trail behind if a rule changed it:
https://www.kace.com/support/kb/index.php?action=artikel&cat=8&id=1046&artlang=en

Comments:
  • I had to use a different code in the "Update Query"section to get it to work. Here the code:

    update HD_TICKET, HD_PRIORITY as T5
    set HD_TICKET.HD_PRIORITY_ID = T5.ID
    where T5.NAME = 'High' and
    HD_TICKET.HD_QUEUE_ID = T5.HD_QUEUE_ID and
    (HD_TICKET.ID in ()) - OlivierH 12 years ago
  • Neither update query works for us. Gilly's doesn't make any change, and Olivier's gives us a mysql error (Error 1064 ER_PARSE_ERROR). Any ideas? - DavidH@jfcs.org 12 years ago
  • You could try this:

    SELECT HD_TICKET.ID, HD_TICKET.TITLE, USER.USER_NAME
    FROM HD_TICKET
    JOIN USER ON (USER.ID = HD_TICKET.SUBMITTER_ID)
    JOIN USER_LABEL_JT ON (USER_LABEL_JT.USER_ID = HD_TICKET.SUBMITTER_ID)
    JOIN LABEL ON (LABEL.ID = USER_LABEL_JT.LABEL_ID)
    WHERE LABEL.NAME rlike 'vip'

    UPDATE HD_TICKET, HD_STATUS
    SET HD_TICKET.HD_STATUS_ID = HD_STATUS.ID
    WHERE HD_STATUS.HD_QUEUE_ID = HD_TICKET.HD_QUEUE_ID
    AND STATUS.NAME='High'
    AND T.ID = <TICKET_IDS>

    Hope that helps!

    John - jverbosk 11 years ago
Posted by: dchristian 12 years ago
Red Belt
2
This could definitely be done with the custom helpdesk rules.

Just next, next through the wizard and add your own SQL statements.

Give it a shot, we'll help if you get stuck.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

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