It's all about the answers!

Ask a question

Accessing list of work items which are having specific text using oslc api


Pallavi Deore (38150) | asked May 14 '19, 12:41 a.m.

Hello Everyone,


I am using CLM 6.0.6.
I want to access RTC work items which are having specific text using oslc API.
As I am new to OSLC API, I have followed OSLC workshop and I got some hint that I can use ?oslc.searchTerms="XXX" to search work items having specific text.

So I use code to accessed following URL:
1)I got Catalog URL.
2)I got Service provider URL
3)I got Simple Query URL: https://ketaki-pc/ccm/oslc/contexts/_WOOUkGc4Eemuucw8hGUKiw/workitems and also able to accessed all work items
4) But while accessing work items having specific text, I am getting exceptions
I use below code :
String queryWIs =simpleQueryURI+"?oslc.searchTerms=\"BI\"";                                         

HttpGet query = new HttpGet(queryWIs);         //getting exception on this line of code.

Execeptions are:
1) Exception in thread "main" java.lang.IllegalArgumentException: Illegal character in query at index 87: https://ketaki-pc/ccm/oslc/contexts/_WOOUkGc4Eemuucw8hGUKiw/workitems?oslc.searchTerms="BI"
2)  java.net.URISyntaxException: Illegal character in query at index 87: https://ketaki-pc/ccm/oslc/contexts/_WOOUkGc4Eemuucw8hGUKiw/workitems?oslc.searchTerms="BI"

Kindly help me where I am wrong and how we can use searchTerms in OSLC??

Accepted answer


permanent link
Pallavi Deore (38150) | answered May 14 '19, 2:45 a.m.

It resolved.

We need to use ASCII code for special characters.
I use below URL:
String queryWIs =simpleQueryURI+"?oslc.searchTerms=%22BPM%22";

Ralph Schoon selected this answer as the correct answer

Comments
Ralph Schoon commented May 14 '19, 8:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Thanks for sharing. 

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.