Quantcast
Channel: Ivanti User Community : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 15294

A Timer Request

$
0
0

We want to log the time an analyst works on a given task.  We want a simple Start Timer/Stop Timer action.  I've looked at the build in Start Clock/Stop Clock actions but this seems to me to be based on a business calendar as used in Incidents and Changes.  I don't see the relevance here with using Tasks.  If someone has an answer for using built in Start/Stop clock, then I'm open.  In the meantime, I've tried to create my own timer for my tasks.

 

Basically, I'm proposing a process (as below) that when the action, Start Timer is clicked, it automatically sets the TimerOn value to DateTime.Now.  This is accomplished through the automatic action, TimeLog that uses the window below and setting the TimerOn value by using the following calculation:

import System

static def GetAttributeValue(ProjectTask):

     Value = DateTime.Now

     return Value

 

When the action, Stop Timer is clicked, it automatically sets the TimerOff value to DateTime.Now.  This is accomplished using the same process as above, but now setting the TimerOff value using the same calculation.

The next automatic action, uses the same window and calculates the TimeLogged value using the following calculation:

import System

static def GetAttributeValue(ProjectTask):

DeltaTime = ProjectTask._TimerOff - ProjectTask._TimerOn

if TimeTaskTotal = 0:

     TimeTaskTotal = DeltaTime

else:

     TimeTaskTotal = TimeTaskTotal + DeltaTime

ProjectTask._TimerOn = 0

ProjectTask._TimerOff = 0

return TimeTaskTotal

 

So nothing is not working.

  1. When I click Start Timer, the action says run successful, but doesn't update my TimerOn value
  2. When I click Stop Timer, the action says run successful, but doesn't update my TimerOff or TimeLogged values

 

I created a couple of string attributes, strTimerOn and strTimerOff to try and debug the calculation, but they don't show any values when the actions are run.

 

My process logic seems plausible to me, yet the execution is failing.  Anyone care to help?

 

 

My Project Task window

Selection_095.png

 

My Project Task process

Selection_096.png


Viewing all articles
Browse latest Browse all 15294

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>