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

Queries in RTC

Hello All,

I am trying to write a query which fetches work items from a project area based on the filtering of Summary filed.

For E.g. say I enter the value in a text field as "hello" then all the work items in a particular project area whose summary contains "hello" should be fetched.

I am a little new to this. I tried few things.
How do I create a proper expression for that ?

Expression newExpr = new VariableAttributeExpression(attribute, AttributeOperation.CONTAINS,
                    What to pass here);

For the above expression how do I pass my Summary String ?


Thanks for any help :)


Regards,
Arshad

0 votes


Accepted answer

Permanent link

Expression newExpr = new VariableAttributeExpression(attribute, AttributeOperation.CONTAINS, "string");
Arshad Adavani selected this answer as the correct answer

0 votes

Comments

Hi Sam,

Thanks for your response,

Expression newExpr = new VariableAttributeExpression(attribute, AttributeOperation.CONTAINS, "string"); doesn't work.

Expression newExpr = new AttributeExpression(attribute, AttributeOperation.CONTAINS,
                    "myText"); worked for me.
I think you also meant the same :)


right ,"string" meant whatever string of text you were searching for

and you got it.. thx for the feedback

Hi Sam,

But how do I filter from a project area ?

I did this :

Expression summaryExpression = new AttributeExpression(attribute, AttributeOperation.CONTAINS, summaryText);

            IQueryResult<IResolvedResult<IWorkItem>> results = queryClient.getResolvedExpressionResults(projectArea,
                    summaryExpression, IWorkItem.FULL_PROFILE);


But it gives me the work items from all the project areas of a repository but it filters based on the text entered.


Regards,
Arshad

you have to add another expression to the expression,
AND,
and then (projectarea)attribute equals ProjectArea

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
× 1,220

Question asked: Mar 24 '16, 7:42 a.m.

Question was seen: 1,721 times

Last updated: Mar 24 '16, 8:17 a.m.

Confirmation Cancel Confirm