It's all about the answers!

Ask a question

Querying Work Items by their planned for / target (IBM RTC Java API)


ramesh m (13310) | asked Sep 29 '15, 11:01 a.m.
  Hi All
   If I am trying to fetch the work items based on the current sprint,
I am  getting java.lang.IllegalArgumentException: Argument must be an instance of IAuditableHandle .
below is my code,
IWorkItemClient workItemClient = (IWorkItemClient) iTeamRepository.getClientLibrary(IWorkItemClient.class);
IAuditableCommon iAuditableCommon = (IAuditableCommon) iTeamRepository.getClientLibrary(IAuditableCommon.class);

IQueryableAttribute planAttribute = factory.findAttribute(projectArea, IWorkItem.TARGET_PROPERTY, iAuditableCommon, monitor);
Expression plan = new AttributeExpression(planAttribute, AttributeOperation.EQUALS, CurrentMilestoneVariable.VARIABLE_ID);
Term term = new Term(Term.Operator.AND);
term.add(plan);
IQueryDescriptor iQueryDescriptor = queryClient.createQuery(projectArea, QueryTypes.WORK_ITEM_QUERY, "AllItems", term); --- getting exception at this line.
Please provide the solution if you did that.

regards, ramesh

One answer



permanent link
Ralph Schoon (63.1k33646) | answered Sep 29 '15, 11:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Sep 29 '15, 11:06 a.m.
I would carefully consider to find the iteration (the IIteration Object) and use it instead of using CurrentMilestoneVariable.VARIABLE_ID

Comments
ramesh m commented Sep 29 '15, 11:21 a.m.

 Could you Please provide the way to find Iteration Object.  Please provide the sample code.


Ralph Schoon commented Sep 30 '15, 2:03 a.m. | edited Sep 30 '15, 2:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

You could search the SDK for IIteration. If you can't search the SDK follow https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/ . If you don't, don't expect to get very far. You can also search that blog which has actually downloadable code for how to work with Timelines and iterations or Google for IIteration.
You can also Google Jazz.net for IIteration i.e. google IIteration site:jazz.net to find posts around this. 

Your answer


Register or 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.