It's all about the answers!

Ask a question

Querying on Custom attributes of WorkItem


Bharath M (5465428) | asked Aug 13 '09, 7:18 a.m.
Hi ,

From one of my previous posts I understand that RTC 2.0 provides better querying capability on Custom fields.We would like to query on a custom field of the workitem. For example, if there is field called "Platform" , when I try to use "exists" on that field, it is ignoring the condition and retrieving all the workitems.

Please suggest?

Thanks,
Bharath

11 answers



permanent link
Patrick Streule (4.9k21) | answered Aug 14 '09, 6:32 a.m.
JAZZ DEVELOPER
This is exactly what I need. But using 'exists' operator didn't
disable the value list. Is there something we need to do?

That is something that I still have to implement
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/40152

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Patrick Streule (4.9k21) | answered Aug 13 '09, 8:50 a.m.
JAZZ DEVELOPER
From one of my previous posts I understand that RTC 2.0 provides
better querying capability on Custom fields.We would like to query on
a custom field of the workitem. For example, if there is field called
"Platform" , when I try to use "exists" on that
field, it is ignoring the condition and retrieving all the
workitems.

Please suggest?

The 'exists' operator allows to find all work items that have the custom
attribute (which can be all). This operator does not need any values (the
value list should actually be disabled -- there is a work item for that).

For regular queries, you would use the default 'is' operator, e.g.
"Platform is 'OS X'"

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Bharath M (5465428) | answered Aug 13 '09, 11:29 a.m.

The 'exists' operator allows to find all work items that have the custom
attribute (which can be all). This operator does not need any values (the
value list should actually be disabled -- there is a work item for that).

This is exactly what I need. But using 'exists' operator didn't disable the value list. Is there something we need to do?

Thanks,
Bharath

permanent link
Bharath M (5465428) | answered Aug 14 '09, 11:13 a.m.
Thanks for the update Patrick

--Bharath

permanent link
Daniel Cox (4261168) | answered Aug 16 '09, 9:31 p.m.
So what is the way to query for all work items which have a non-empty value for a custom text field?

permanent link
Patrick Streule (4.9k21) | answered Aug 17 '09, 11:20 a.m.
JAZZ DEVELOPER
So what is the way to query for all work items which have a non-empty
value for a custom text field?

There is an 'Unassigned' text box in the condition field of the Eclipse UI
-- in the Web UI, 'Unassigned' is part of the values in the list control.
Select that and choose the 'is not' operator

e.g.: MyCustomString 'is not' 'Unassigned'

--
Regards,
Patrick
Jazz Work Item Team

Comments
SEC Servizi commented May 16 '13, 9:34 a.m. | edited May 16 '13, 9:47 a.m.

There is an API constant to refer to the 'Unassigned' value?

It seems anĀ externalized UI string... Can we use "Literals.getUnassignedLiteral(null)" from "com.ibm.team.workitem.service.internal.util.Literals"?
Thanks in advance.


permanent link
Daniel Cox (4261168) | answered Aug 20 '09, 11:47 a.m.
Ahh - I don't use the Eclipse UI much - I do see the unassigned checkbox there and it does work as expected. However in the web UI I do not see a list to choose from. I only have a textbox to enter the text value in. The field is of type small string.

Have you seen this actually work for a string field in the Web UI? Some lightweight digging in filed work items did not immediately lead to one for this issue.

I'm using FF3.5, when going to IE8 - I get a "loading..." in red text above the text field in the query that never goes away.

BTW - I think the "Version (Bugzilla)" field in the RTC project (jazz.net) is a text field. Querying against showed me the same.

permanent link
Patrick Streule (4.9k21) | answered Aug 21 '09, 8:25 a.m.
JAZZ DEVELOPER
Have you seen this actually work for a string field in the Web UI?
Some lightweight digging in filed work items did not immediately lead
to one for this issue.

You are right, it is actually missing for strings. This is
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/42069

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Daniel Cox (4261168) | answered Aug 21 '09, 10:17 a.m.
Any chance I can convince you to get this into 2.0.0.2? :)

permanent link
Patrick Streule (4.9k21) | answered Aug 22 '09, 5:41 a.m.
JAZZ DEVELOPER
Any chance I can convince you to get this into 2.0.0.2? :)

Yes :) I set the 'Planned for' to 2.0.0.2.

--
Regards,
Patrick
Jazz Work Item Team

Your answer


Register or 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.