Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



One answer

Permanent link
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:
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.

0 votes

Comments

What is the service associated with ITimeSheetEntry objects?

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Nov 05 '08, 9:24 a.m.

Question was seen: 7,272 times

Last updated: Apr 24 '15, 1:51 p.m.

Confirmation Cancel Confirm