I have no experience of MYSQL, but was wondering if anyone could guide me on how to create a ticket that runs only on specific months.
I downloaded the rule template from this KB (http://www.kace.com/support/kb/index.php?action=artikel&cat=8&id=719) and this works well for normal weekly or monthly tickets.
If I could get the rule to run on specific months for certain tickets that would be great.
Any help is greatly appreciated!!!
Answer Summary:
You can add the month function to the where of your SQL statement. For example to run the rule every other month you could do this: MONTH(NOW()) IN (1,3,5,7,9,11)
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

3
You can add the month function to the where of your SQL statement. For example to run the rule every other month you could do this:

MONTH(NOW()) IN (1,3,5,7,9,11)
Answered 03/29/2012 by: dchristian
Red Belt

  • This is the syntax from the rule template I downloaded

    select EMAIL QUEUEMAIL,
    MONTHNAME(NOW()) MONTH FROM USER
    JOIN USER_LABEL_JT UL ON USER.ID=UL.USER_ID
    JOIN
    HD_QUEUE_OWNER_LABEL_JT QO ON QO.LABEL_ID=UL.LABEL_ID
    JOIN HD_QUEUE Q ON Q.ID=QO.HD_QUEUE_ID
    WHERE EMAIL_USER = SUBSTRING_INDEX(EMAIL,'@',1)
    and EMAIL = 'servicedesk@10.xx.xx' /* change this to match your queue's primary email address */
    and Q.NAME='The K1000 Service Desk' /*change this to match your queue name */

    What do I need to change to get the rule to run every other month?
    • select EMAIL QUEUEMAIL,
      MONTHNAME(NOW()) MONTH FROM USER
      JOIN USER_LABEL_JT UL ON USER.ID=UL.USER_ID
      JOIN
      HD_QUEUE_OWNER_LABEL_JT QO ON QO.LABEL_ID=UL.LABEL_ID
      JOIN HD_QUEUE Q ON Q.ID=QO.HD_QUEUE_ID
      WHERE EMAIL_USER = SUBSTRING_INDEX(EMAIL,'@',1)
      and EMAIL = 'servicedesk@10.xx.xx' /* change this to match your queue's primary email address */
      and Q.NAME='The K1000 Service Desk' /*change this to match your queue name */
      AND MONTH(NOW()) IN (1,3,5,7,9,11)
Please log in to comment
Answer this question or Comment on this question for clarity