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

[RTC EWM] I want to get the list of created queries using API.

I think we create and use it every day.
I want to get the name and URL of that shared query.
Ideally it can be obtained using the REST API.
It is intended to automate exports and remove randomly created unwanted queries.

I am waiting for your idea.

Thanks

0 votes


Accepted answer

Permanent link

 Please see: https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Using_Stored_Queries



The headers you use decide if you get the queries just by link, or get the queries with more information.

As an example Accept:text/xml has worked best for me. 

Request GET https://elm.example.com:9443/ccm/oslc/queries/_MV9ncHHZEeuKHaIVR_wUnA/rtc_cm:results
Request Headers
    Accept text/xml; charset=utf-8
    

HIROAKI JOSAKO selected this answer as the correct answer

0 votes

Comments

Hi Ralph
Thanks example code
I tried to get the list with this code but it didn't work.

Request GET https://elm.example.com:9443/ccm/oslc/queries.xml?oslc_cm.query=rtc_cm%3AprojectArea%3D%22_8e5qfFpmEeukW7cqqDjAuA%22

I specified a project area, but all the server queries are retrieved.
 

Sorry!!
I tried it again and it worked! !!
That was a really big help.

Thanks!

I found various cases, where my query was incorrect and I got every query back, instead an error.

That was exactly right.
When I mistyped this part, I was getting all the queries on the Server.

oslc_cm.query = rtc_cm: projectArea =

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
× 10,941

Question asked: Jun 07 '21, 3:41 a.m.

Question was seen: 1,200 times

Last updated: Jun 25 '21, 2:46 a.m.

Confirmation Cancel Confirm