Querying Work Items by their planned for / target (IBM RTC Java API)
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
I would carefully consider to find the iteration (the IIteration Object) and use it instead of using CurrentMilestoneVariable.VARIABLE_ID
Comments
Could you Please provide the way to find Iteration Object. Please provide the sample code.
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.