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

rqm REST API: get all testphase with a title name is not working

 Hello all,



Unfortunately it gets me not only the testphases with the title="ABC40_TT#433". There a lot of testphases with other title names. Can someone help me? :)

Thanks!

0 votes

Comments

IME the ETM reportable rest filters like you're trying seem to return everything when the filter is malformed - however I don't have a better suggestion for you to try, excep ttry dcterms:title instead of tite. Or search the forum for an example reportable rest call that works then work from there. 

This is a example from the documentation: <feedUrl>?fields=feed/entry/content/testplan[title='test plan title']/description 
my query looks similar. I've tried it also with dcterms:title, unfortunately it does also not work



3 answers

Permanent link

That URI looks like an ETM reportable rest API. Have you looked at using OSLC Query?
For example, is there a query capability for test phases?

0 votes

Comments

Thanks for the quick reply. What do you mean exactly with query capability for testphases? We are currently only using rest api queries. I think as Ian Barnard mentioned, maybe the filter is not set up correctly. But i'm doing it exactly as it is described in the documentation. This is a example from the documentation: <feedUrl>?fields=feed/entry/content/testplan[title='test plan title']/description



Permanent link
I've found out that the filter is not working due to the # character. 
Does not work:

This works:

The query works only for nomal characters. Does someone have an idea how i can make it work for special characters like "#"? 

0 votes


Permanent link

Have you tried URL encoding the query parameter values in the request URI?



0 votes

Comments
Thanks for the reply. I have encoded the fields query parameter like you described it, but then i got a 400 bad request error.

Then i added one more "#" to the title string like this: [title="ABC40_TT##433"]. I've encoded the url again and somehow i've got all the testphases with the titlename ABC40_TT#433.

This means if we have a value which contains one "#", then the get request will probably fail. I think we need to send the request with doubles hashs.This means:
To get testphases with title=ABC40_TT#433 we need to send a url encoded query with title=ABC40_TT##433. 
What do you think? I'm not sure about it

All query parameter values in an HTTP reqeust should be URL encoded. This applies to all HTTP requests. If the REST service you are calling cannot process this, I would regard that as a defect in that REST service.

Remember that it is the parameter values that should be encoded, not the parameter name and '='.

You can also try free online tools like https://www.freeformatter.com/url-parser-query-string-splitter.html and https://url-decode.com/tool/url-parser and try your original URI. If you do that, you see that the #433 is taken as the hash fragment and is not part of the query parameter value. That's because the URI was not correctly formed by URL encoding the parameter value.

If you try the proper URI, you see the URL encoded fields parameter value extracted in full. Applications should perform URL decoding of such values. If they do not, that's a defect in that application.


The parameter values are encoded.

i have encoded this part: fields=feed/entry/content/testphase[title="ABC40_TT#433"]
The encoded url looks extactly like the one you mentioned in your answer above:
This throws me an 400 error.

Then i added an extra "#" to the title and encoded it:  fields=feed/entry/content/testphase[title="ABC40_TT##433"]


This is getting me all the testphases with the titlename ABC40_TT#433. Thats confusing for me, cause I was expecting this from the first mentioned encoded url. 

I recommend submitting a defect against ETM.

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
× 12,019
× 479
× 137
× 34

Question asked: Aug 11 '22, 8:42 a.m.

Question was seen: 1,769 times

Last updated: Aug 12 '22, 11:13 a.m.

Confirmation Cancel Confirm