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

Exception while creating work item using client Java API

Hi All,
I am following this link to create work item using client java API.
I copied code under Plain-Java Client section. When I execute this class, It gives me below exception

com.ibm.team.repository.common.ItemNotFoundException: CRJAZ0215E The following record was not found in the database: com.ibm.team.workitem.common.internal.model.impl.WorkItemHandleImpl@24342434 (stateId: <unset>, itemId: [UUID _4ZUWoJQQEeWpSOBmN0ZPzQ], origin: com.ibm.team.repository.client.internal.TeamRepository@45144514, immutable: <unset>)

When I executed this code in debug mode I found that 
WorkItemInitialization operation= new WorkItemInitialization(summary, category);
IWorkItemHandle handle= operation.run(workItemType, null);
IWorkItem workItem= auditableClient.resolveAuditable(handle, IWorkItem.FULL_PROFILE, null);

handle reference was not found in database and exception is thrown at last line in above code snippet.
How can I resolve this error?

Thank You

0 votes



One answer

Permanent link
 I have used code based on that example many times now. This kind of code works for me. I have published WorkItemOperation based automation examples on https://rsjazz.wordpress.com/. I can not remember having seen this error. Usually there is more information. Anyway, you can try to

  • Test against a test system and remove the required attributes for work items to make sure they can get created
  • Set the required attributes while creating the work item

 

0 votes

Comments

It worked for me. 

I downloaded package com.ibm.team.workitem.ide.ui.example given on this link. Imported this package into my RTC eclipse and executed "CreateWorkItem.java". It worked for me without throwing any exception.

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,978

Question asked: Nov 26 '15, 2:49 a.m.

Question was seen: 2,525 times

Last updated: Nov 30 '15, 5:51 a.m.

Confirmation Cancel Confirm