Tuesday, 24 May 2016

Calculate Actual Spent Time-Service Request

from psdi.util.logging import MXLogger
from psdi.util.logging import MXLoggerFactory
from psdi.mbo import MboConstants

print "CALCSPENTTIME - BEGIN"
#print "Calculate Duration"

#Log for debugging
#logger = MXLoggerFactory.getLogger("maximo.script");
#logger.debug("ScriptName" + launchPoint)

actual_start = mbo.getDate("ACTUALSTART")
actual_finish = mbo.getDate("ACTUALFINISH")
if (actual_start is not None and actual_finish is not None):
    actual_duration = (actual_finish.getTime() - actual_start.getTime())/3600000.0
    mbo.setValue("ACTDUR", actual_duration,MboConstants.NOACCESSCHECK)

#print "End Calculate Duration"
print "CALCSPENTTIME - END"

No comments:

Post a Comment

IBM Readme for IBM Maximo Asset Management 7.6.1.3 Fix Pack

  Fix Readme Abstract This fix pack updates IBM® Maximo® Asset Management version 7.6.1, 7.6.1.1, and 7.6.1.2 Content IBM Maximo Asset Manag...