I'm working on an attribute launch point that will trigger a communication template when a Service Request status changes. The script runs as desired, but the substitution variable
:tkstatus.memo is not being expanded in the resulting email. The other values appear and the variable syntax seems correct because the memo is expanded when using Create - Communication with the same template. The only google reference I could find to the question basically said "yep, that's a problem all right" from five years ago.
Has anyone successfully done this? Thanks.
Here's the text of the communication template:
The service request number :ticketid ":description" has been changed to :status with the comment ":tkstatus.memo"
To visit the service request and learn more, click this link: <http://:hostname/maximo/ui/maximo.jsp?event=loadapp&value=VIEWSR&changetab=main&additionalevent=sqlwhere&additionaleventvalue=ticketid=':ticketid'>
And the script. The launch point is on the Validate event.
load("nashorn:mozilla_compat.js");
importPackage(Packages.psdi.mbo);
importPackage(Packages.psdi.server);
importPackage(Packages.psdi.util);
if (mbo.isModified("status") && srStatus!="CLOSED") {
var comTmpltSet=MXServer.getMXServer().getMboSet("COMMTEMPLATE", MXServer.getMXServer().getSystemUserInfo());
comTmpltSet.setWhere("templateid='SRSTATUS'");
comTmpltSet.reset();
comTmpltSet.getMbo(0).sendMessage(mbo,mbo);
}
------------------------------
Robert Goff
------------------------------
#AssetandFacilitiesManagement#MaximoIntegrationandScripting#Maximo