Saving a work item working copy withIRepositoryItemService
I am working on a follow-up condition that attempts to update the child work item states to the same state of a parent (Modify and save a workitem in a follow-up condition code extension).
The code successfully retrieves the parent work item state and each child work item linked to the parent. For each child work item, the code successfully gets a working copy and the child state is updated to the same as the parent state.
After the child state is updated in the working copy, the IRepositoryItemService is used to save the working copy. The following exception is thrown and the save is unsuccessful:
com.ibm.team.process.common - Access violation in component item service. Service component: jazz.service.example.extensionService1, Model component: com.ibm.team.workitem, Item type: com.ibm.team.workitem#WorkItem
com.ibm.team.repository.common.InternalRepositoryException: Access violation in component item service.
My current understanding of the Jazz / RTC architecture, the follow-up code is not allowed to update items via the IRepositoryItem Service that my follow-up component did not create. Is there an API that is exposed to allow me to save these child work items via the follow-up code module? If so, please provide a code snippet.
The code successfully retrieves the parent work item state and each child work item linked to the parent. For each child work item, the code successfully gets a working copy and the child state is updated to the same as the parent state.
After the child state is updated in the working copy, the IRepositoryItemService is used to save the working copy. The following exception is thrown and the save is unsuccessful:
com.ibm.team.process.common - Access violation in component item service. Service component: jazz.service.example.extensionService1, Model component: com.ibm.team.workitem, Item type: com.ibm.team.workitem#WorkItem
com.ibm.team.repository.common.InternalRepositoryException: Access violation in component item service.
My current understanding of the Jazz / RTC architecture, the follow-up code is not allowed to update items via the IRepositoryItem Service that my follow-up component did not create. Is there an API that is exposed to allow me to save these child work items via the follow-up code module? If so, please provide a code snippet.
One answer
You have to use the work item service to save work items.
When a component (Work Item, SCM, Build, etc.) defines an item, they
also provide a service which allows you to save those items. Only this
service can use the repository item service to save the item to the repo.
Jared Burns
Jazz Process Team
bcope wrote:
When a component (Work Item, SCM, Build, etc.) defines an item, they
also provide a service which allows you to save those items. Only this
service can use the repository item service to save the item to the repo.
Jared Burns
Jazz Process Team
bcope wrote:
I am working on a follow-up condition that attempts to update the
child work item states to the same state of a parent (Modify and save
a workitem in a follow-up condition code extension).
The code successfully retrieves the parent work item state and each
child work item linked to the parent. For each child work item, the
code successfully gets a working copy and the child state is updated
to the same as the parent state.
After the child state is updated in the working copy, the
IRepositoryItemService is used to save the working copy. The
following exception is thrown and the save is unsuccessful:
com.ibm.team.process.common - Access violation in component item
service. Service component: jazz.service.example.extensionService1,
Model component: com.ibm.team.workitem, Item type:
com.ibm.team.workitem#WorkItem
com.ibm.team.repository.common.InternalRepositoryException: Access
violation in component item service.
My current understanding of the Jazz / RTC architecture, the follow-up
code is not allowed to update items via the IRepositoryItem Service
that my follow-up component did not create. Is there an API that is
exposed to allow me to save these child work items via the follow-up
code module? If so, please provide a code snippet.