cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How to reassign a task to another user in Windchill ?

nkumar-10-11-122
1-Newbie

How to reassign a task to another user in Windchill ?

hi

3 REPLIES 3

Hi,

How to do that using API?

@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  

Top Tags