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

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);

0 votes


Accepted answer

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

0 votes

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

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
× 411
× 169

Question asked: Sep 14 '15, 6:47 a.m.

Question was seen: 3,178 times

Last updated: Sep 15 '15, 3:15 a.m.

Confirmation Cancel Confirm