How to fetch WorkItems based on "Found In" (release) value?
The below code didn't work for me. Please let me know what variable that need to pass to expression to get value found in? how it can be done?
WorkItemTypeVariable variable = new WorkItemTypeVariable("Release1"); IQueryableAttribute foundInAttribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectArea, IWorkItem.FOUND_IN_PROPERTY, auditableClient, monitor); Expression foundInExpression = new AttributeExpression(foundInAttribute, AttributeOperation.EQUALS, variable); Term term = new Term(Operator.AND); term.add(foundInExpression); com.ibm.team.workitem.common.query.IQueryResult<IResolvedResult<IWorkItem>> results = queryClient.getResolvedExpressionResults(projectArea, term, IWorkItem.FULL_PROFILE); |
Accepted answer
Ralph Schoon (63.5k●3●36●46)
| answered Sep 15 '15, 2:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Sep 15 '15, 2:34 a.m.
As stated in the answer to your question https://jazz.net/forum/questions/206015/how-to-get-the-workitems-based-on-filed-against-value you can't just put in a string. You have to find the object using the string from all the existing releases and pass the object or handle.
This is, of course, true for all attribute types that are not strings. Sridhar Kuna selected this answer as the correct answer
Comments From my latest version of https://rsjazz.wordpress.com/2015/02/09/a-rtc-workitem-command-line-version-2/
/* * Find a deliverable (release) object from its name Deliverables don't have * ID's, so you can only search for the value. * * @param value * - the name of the deliverable * @return the deliverable object * @throws TeamRepositoryException / private IDeliverable findDeliverable(String value) throws TeamRepositoryException { return getWorkItemCommon().findDeliverableByName( getWorkItem().getProjectArea(), value, IDeliverable.FULL_PROFILE, monitor); } |
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.