The web blog http://www.learnsccd.com strives to be a comprehensive guide to SCCD, TADDM, SERVICE NOW and MAXIMO tools. This is a personal site maintained solely by me. I intend to update it regularly.For live updates please follow us on.

Set Service Request Activity Status to Queued

Set Service Request Activity Status to Queued

from psdi.server import MXServer
from psdi.mbo import SqlFormat

 print "SRACTQUEUED - BEGIN"
 #print "Set Status to Queued"
 strstatus = mbo.getString("STATUS")
 if (strstatus <> 'QUEUED'):
     mxServer = MXServer.getMXServer()
     mbo.changeStatus("QUEUED", mxServer.getDate(), "")

 strowner = mbo.getString("OWNER")
 strownergroup = mbo.getString("OWNERGROUP")

 if (strowner <> '' or strownergroup <> ''):
     #print "Send Email Notification"
     sqlf = SqlFormat("templateid='SRTASKASSIGN' and objectname='WOACTIVITY' and status='ACTIVE'")
     commTemplateSet = mbo.getMboSet("$commtemplate", "COMMTEMPLATE", sqlf.format())
     commTemplateMbo = commTemplateSet.getMbo(0)
     if commTemplateMbo is not None:
         commLogMbo = mbo.createComm()
         commLogMbo.copyFromTemplate(commTemplateMbo)
         commLogMbo.sendMessage()
 else:
     errorgroup="ACTIVITY"
     errorkey="NOASSIGNMENT"
 #print "End Send Notification"

 print "SRACTQUEUED - END"