It's all about the answers!

Ask a question

How do I get workitems by tags?


Richard Ekblom (1111) | asked Nov 16 '12, 5:25 a.m.
 Hello!

I'm trying to use the RTC REST API (version unknown but the URL below may give a hint) to get a list of workitems that contains a specific tag.

If i execute a GET with URL:

   https://mycompany.com/jazz/rpt/repository/workitem?fields=workitem/workItem[tags=|my_tag|]/(id|summary)

...I get a list of workitems that have "my_tag" set (but ONLY "my_tag" set). 
So what is the URL for listing workitems that have "my_tag" and possibly any additional tags set at the same time??? I have tried wildcards (*) and even XPath functions like contains() without success.


My problem is the same as in topic but it's not solved it seems:
https://jazz.net/forum/questions/12782/using-wildcards-in-search-for-tags-in-report


regards,
/Richard

2 answers



permanent link
Rafik Jaouani (5.0k16) | answered Nov 16 '12, 9:47 a.m.
JAZZ DEVELOPER

This is a limitation of the syntax of the Rest API URLs. Currently we do not support a 'like' operator. So I would  agree this makes querying using tags unusable. Pelase fell free to raise an enhancement request.


Comments
Richard Ekblom commented Nov 16 '12, 10:53 a.m.

Ok, this means that I have to get all workitems and then manually filter on tags. I will take a look at "raise an enhancement request" Thanks Rafik.


permanent link
Lauren Hayward Schaefer (3.3k11727) | answered Nov 16 '12, 7:26 a.m.
JAZZ DEVELOPER
Hi Richard,
It looks like the issue was fixed in 2.0.  See https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=70480.  I did a quick test on our server and got the same result you did.  I added a comment to the work item asking if there is any special formatting we should be using.

Comments
Richard Ekblom commented Nov 16 '12, 10:51 a.m.

Thank you Lauren! 

Your answer


Register or to post your answer.