Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
hi
Hi,
How to do that using API?
To do this grammatically (using API), you can use below code snippet:
ObjectIdentifier oid = ObjectIdentifier.newObjectIdentifier("wt.workflow.work.WorkItem:319469"); WorkItem wi = (WorkItem) PersistenceHelper.manager.refresh(oid); System.out.println("WorkItem Name: " + wi.getIdentity()); System.out.println(" Workitem Owner (Before delegate): " + wi.getOwnership().getOwner().getIdentity()); WTUser user = wt.org.OrganizationServicesHelper.manager.getAuthenticatedUser("shirish"); WTPrincipal principal = (WTPrincipal) user; wt.workflow.work.WorkflowHelper.service.delegate(wi, principal); System.out.println(" Workitem Owner (After delegate): " + wi.getOwnership().getOwner().getIdentity());
I hope this will help you.
Regards,
Shirish