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


Please log in to comment



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

Answered 10/15/2012 by: chucksteel
Red Belt

  • 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.
  • 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:

    VALUES (
    [hard code a user id here],
    &amp;amp;quot;Work added by rule&amp;amp;quot;,

    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.
Please log in to comment
Answer this question or Comment on this question for clarity