Skip to main content
1-Visitor
Nov 10, 2016 6:58 AM UTC
Question

How to reassign a task to another user in Windchill ?

hi

3 replies

12-Amethyst
Dec 18, 2018 10:19 AM UTC

Hi,

How to do that using API?

Translate
ShirishMorkhade
16-Pearl
Dec 18, 2018 12:09 PM UTC

@rzemmali,

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  

Translate