It's all about the answers!

Ask a question

ClearQuest OSLC 2.0 REST API Session Variables


Michał Kotas (13113) | asked May 15 '13, 6:58 a.m.
retagged May 16 '13, 10:56 a.m. by Krzysztof Kaźmierczyk (7.4k373103)
 Hi,

I'm unable to find any information about my problem. Maybe someone from jazz community will be able to help me.

Question:
Is it possible to get and set clearquest session variables using REST API? I mean equivalent of cq api: $session->SetNameValue() $session->GetNameValue()

Accepted answer


permanent link
Yuhong Yin (25123) | answered May 16 '13, 4:48 p.m.
JAZZ DEVELOPER
Hi Michal,

You can you can set your own session variable by doing a PUT call to
http://server/cqweb/oslc/repo/<your-dbset>/db/<your-db>/session

Here is an example of the xml file - this sets session variable _MY_CQ_OSLC_SESSION, and clears _OTHER_CQ_SESSION (I am not suggesting you clear session variable set by CQWeb though - just an example)

<?xml version="1.0" encoding="UTF-8"?>
<cq:Session xmlns:cq="http://www.ibm.com/xmlns/prod/rational/clearquest/1.0/">
<cq:property cq:name="_MY_CQ_OSLC_SESSION">MY_OSLC_SESSSION</cq:property>
<cq:property cq:name="_OTHER_CQ_SESSION"></cq:property>
</cq:Session>

Note, you cannot retrieve session variable with OSLC call, but you can use them in your CQ hook once you set via a PUT call.

Hope this helps,

- Yuhong

Yuhong Yin

Sr. Dev Manager, ClearCase/ClearQuest Jazz Integrations
Michał Kotas selected this answer as the correct answer

3 other answers



permanent link
Michał Kotas (13113) | answered May 17 '13, 5:13 a.m.
 Hi,

Works as expected. Thanks for comprehensive answer.

permanent link
Matthew Alexander (18126) | answered May 15 '13, 9:54 a.m.
JAZZ DEVELOPER
Hi Michal,

Do the examples on this wiki help?  If not, let me know and I'll find someone who can help.

https://jazz.net/wiki/bin/view/Main/CqOslcV2

permanent link
Michał Kotas (13113) | answered May 16 '13, 3:29 a.m.
Hi Matthew,

Thanks for quick hint. This wiki article is very helpful in general. There are some informations in "Session Management" part, but unfortunately this is not what I'm looking for.

What I would like to know is how to use clearquest session variables. I'm looking for equivalent of:
Using Session variables

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.