Deleting work items using migration handler
One answer
Comments
Hi Vladimir,
We tried to use the IWorkItemRestService to delete the work items during the repotools import process. However this fails silently and the work items don't get deleted. We also tried the IWorkItemServer APIs, but did not succeed even with that. There is no error in the repotools log but the work items don't get deleted. So just wondering what we are missing here.
Thanks.
Only thing that comes to mind is permissions for the authenticated user. Is this user a member of JazzAdmins? Or it has role in every project area that as permission to delete work item?
MigrationHandler is getting executed during repotools-ccm -import. Is there a way to set permissions for this case.
Oh, I see.I don't think so, it should use credentials for direct access to DB, without application authorization. I was treating "custom" as self-written from scratch, but not using repotools framework.
Thanks for your reply. In that case, How can we delete the WorkItems from our custom service which is getting invoked during import.
This work item may contain some clue: https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=149428&tab=com.ibm.team.workitem.tab.links
At least it states use of com.ibm.team.repository.service.IRepositoryItemService.deleteItem(IItemHandle)
Had tried this as well.
Got Exception INFO: Exception while deleting work item: Access violation in component item service. Service component: com.ibm.research.automation.metrics, Model component: com.ibm.team.workitem, Item type: com.ibm.team.workitem#WorkItem
Sorry, but I'm out of ideas here. Maybe you should add some tags like "extending" and "rest-api" to attend people with deeper knowledge of subject.