Technical Blog Post
Changing Ticket Owner to the New Assignee of Workflow Reassignment (v7.5 or v7.6)
If a ticket, i.e. service request, incident or problem, is in workflow; then it might have both workflow assignments and an owner set. Usually the owner is set parallel to the workflow assignment via actions in workflow. But, when we reassign the workflow assignment using the Reassign button of workflow dialogs, then owner remains as the old one and it should also be changed manually.
We can use Automation Scripts for automating the manual change of ownership. We may write either an object level (REASSIGNWF) or an attribute level (REASSIGNWF.ASSIGNEE) python script in order to change the ownership of ticket simultaneously during workflow reassignment. REASSIGNWF is the non-persistent Maximo object which is used in workflow dialogs and ASSIGNEE is the substitute person for assignment. In the script below, we first check that our record is a ticket because workflow structure is generic for all records and we want to restrict our solution to tickets only. Then, we further check specific conditions namely XXCONDITION which is a conditional expression defined from Conditional Expression Manager. This part is specific to needs of the implementor and can vary.
from psdi.mbo import Mbo, MboRemote, MboSet, MboSetRemote from psdi.app.ticket import Ticket, TicketRemote, TicketSet, TicketSetRemote ownerMbo = mbo.getOwner() if(ownerMbo.isBasedOn("TICKET") and ownerMbo.evaluateCondition("XXCONDITION")): ownerMbo.applyOwner(mbo.getString("ASSIGNEE"))