Instead of an automation script to do this, you could add the createsr signature option to the application and to the select action menu.
Out of the box, this creates a new SR and opens it in the application, if your application is a clone of the SR application, then this should work also.
------------------------------
Stephen Hume
Sheffield Scientific LLC
------------------------------
Original Message:
Sent: 11-27-2023 04:26
From: Blaz Rakar
Subject: Automation script to create TICKET
Hello all,
I am trying to create automation script in Maximo 7.6.1.3 in custom application where main object is SR (app its created from original application VIEWSR) button when user click on it to create new SR so new TICKET and if is possible to even open this new ticket directly then in other application where main object is also SR. Maybe anybody know how to achieve that? I am trying for a start to create a TICKET from here and I get error "BMXAA4195E - A value is required for the Ticket field on the TICKET object." I tried something like that:
from psdi.mbo import MboConstants
from psdi.mbo import MboRemote
# Create a new Ticket with a relationship to MXZTICKET
ticketSet = mbo.getMboSet("MXZTICKET")
newTicket = ticketSet.add()
# Set mandatory fields for the Ticket object
##newTicket.setValue("TICKETID", str(ticketSet.getMbo(0).getUniqueIDValue()))
newTicket.setValue("DESCRIPTION", "TEST dogodka")
newTicket.setValue("CLASS", "SR")
newTicket.setValue("STATUS", "NEW", MboConstants.NOACCESSCHECK)
# Set other attributes as needed
# Save the new Ticket
ticketSet.save()
# Get the ID of the newly created Ticket
newTicketId = newTicket.getInt("TICKETUID")
Best regards
#ServiceProvider
------------------------------
Blaz Rakar
Slovenske Zeleznice d.o.o.
------------------------------