execute query to search work items
![]()
Hi all,
I am trying to develop a function to search work items by any term within a project area.
My code works fine for the standard attributes:
Code:
I added 3 custom attributes and i need to search within these fields. So, i added the following lines:
When i try to process the results with:
I get every time an exception:
Thanks in advance.
(please let me know If there is a way to use a REST webservice to search work items in a particular project area)
|
2 answers
![]() "I can display my custom attributes in the results, but i'm not able to set a condition on these attributes." Something is definitely wrong with that. As I said, I would focus on fixing that. Have you contacted IBM Support? " I wanna have a score in combination with the results. When i use a manually defined query, I can't get a score..." As I said, I would use JRS for that. It'll be a hundred times easier to implement than creating a Java API script, and a hundred times faster to run. If you can't use JRS, I would also consider BIRT. |
Comments
Your code looks ok.
Are you sure this attribute allows the CONTAINS operation? Is it a String type attribute? Can you use such condition for that attribute creating the query manually? Does replacing CONTAINS with EQUALS make your script work or it also fails?
I always found the Query API a bit complicated. Is there a good reason to build all the conditions using this API like you are doing, instead of creating the query manually and just run it using the API? That would be a lot easier.
Hi Miguel,
This attribute is from the type of "Large HTML".
I tried to use EQUAL and it doesn't work as well as the CONTAINS operation.
When I try to create the query in the web UI, I can not see my custom attributes.
The reason why I wanna use the Java API is, I would like to develop a search across several project areas.