/build/static/layout/Breadcrumb_cap_w.png

Can a ticket rule be used to add work time?

We have a tasks that have a consistent work time of 15 min that I would like create a rule that adds 15 min on save.


0 Comments   [ + ] Show comments

Answers (1)

Posted by: chucksteel 11 years ago
Red Belt
0

It should be possible. How will the technicians indicate that they performed a task that meets the criteria?


Comments:
  • I will be keying off the ticket title. These specific tasks are generated from monitoring software, so we have full control over the title structure. - Trusner 11 years ago
  • I did some checking and you would need to run an INSERT statement into the HD_WORK table. The statement would look something like this:

    INSERT INTO HD_WORK (HD_TICKET_ID, USER_ID, NOTE, START, STOP, ADJUSTMENT_HOURS)
    VALUES (
    <TICKET_IDS>,
    [hard code a user id here],
    &amp;amp;quot;Work added by rule&amp;amp;quot;,
    NOW(),
    NOW(),
    0.15)

    I haven't tested this but I believe it would do the job. I have the [hard code user id here] because it seems it would be the best way to signify that the work was added via a rule. I would probably create a bogus user in KACE and use that userid. Note that this also sets the start and end times for the work to the same value.

    You also need to be careful that the select statement will return only one ticket so that the TICKET_IDS variable only contains one ticket ID. If the rule is set to run on save this shouldn't be an issue. You should also have your select statement query the HD_WORK table to make sure the work hasn't already need added for this ticket, otherwise every time the rule runs it will add the work time again.

    I have never tried placing in INSERT statement where the UPDATE statement normally goes but as far as I know this is possible.

    If you give this a shot and have trouble please post your code so we can help figure it out further. - chucksteel 11 years ago
 
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