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

How to build a query that returns a list of workitems by owner name?(or other contributor)

 Hi ,

How to build a query that returns a list of workitems by owner?(or other contributor)

I use this code in other cases (eg, using the ID in the query):
I do not know how to build a query for example Owner name or other type Contributor

 IAuditableClient auditableClient = (IAuditableClient) repository
        .getClientLibrary(IAuditableClient.class);

    IQueryClient queryClient = (IQueryClient) repository.getClientLibrary(
        IQueryClient.class);

    IQueryableAttribute attribute = QueryableAttributes.getFactory(
        IWorkItem.ITEM_TYPE).findAttribute(baseProjectArea,
        IWorkItem.ID_PROPERTY, auditableClient, null);

    Expression expression = new AttributeExpression(attribute,
        AttributeOperation.EQUALS, 999); // for example id number: 999


I will be grateful for any help you can provide

0 votes



4 answers

Permanent link
 But how get right ContributorHandle , having a user name instead of userID?

 I do not want to download a list of all users, and than choose the right but  get one user(Contributor) using the user name (not userID)

Thank you @sam for your interest

0 votes


Permanent link
You have to do the same as above, but use the IContributorManager class to find the contributor record for the user u seek

then change the code you have to get the attribute handle for the Owner field

    IQueryableAttribute attribute = QueryableAttributes.getFactory(
        IWorkItem.ITEM_TYPE).findAttribute(baseProjectArea,
        IWorkItem.ID_OWNER auditableClient, null);

then set the expresssion to equal the contributor you seek

    Expression expression = new AttributeExpression(attribute,
        AttributeOperation.EQUALS, ContributorHandle);

1 vote


Permanent link
 I Ask about JAVA plain API

0 votes


Permanent link
Hi

In RTC web client, click on Workitems->Create Query.
Click on 'Add Condition' and select 'Owned By' condition.
Add the User for which you need to get the list of workitems.
Click Run.

Best Regards
Rajat

0 votes

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,926
× 411

Question asked: Dec 18 '12, 8:36 p.m.

Question was seen: 4,987 times

Last updated: Dec 19 '12, 9:17 a.m.

Confirmation Cancel Confirm