It's all about the answers!

Ask a question

Accessing ClearQuest programatically


Ana Ana (31111) | asked Nov 12 '10, 11:04 a.m.
Hi,

I need to access ClearQuest programatically using C#. I just found ClearQuest OSLC REST API. Client is planning to use ClearQuest web 7.1.1. I read that it comes with OSLC REST API out the box. Can someone please provide me some examples on how I can access the CQ through C# or Java using this API. I much appreciate any info.

Thank you,
Ana

24 answers



permanent link
Arun Kumar (633) | answered May 07 '12, 4:21 a.m.
Hi All,

Wanted to Modify a CQ Field by using Perl (CQ Web). Is there any Sample perl Script to Modify a Particular Field (Note Entry).


regards,
Arun

permanent link
Alex Ng (11) | answered May 02 '11, 4:00 p.m.
From my investigation so far, it failed due to the fact that ClearQuest 7.1.2.2 cannot take in multipart/form content type:

$header->header('Content-Type' => 'multipart/form-data; boundary=UdCwYxcWhVYyLPJCRxQTEowAxgcepp');


Regards,

Lex

Hi Yuhong,

I'm getting error 415 when I run it in my schema:

status = 415 Unsupported Media Type

I used Windows to create a dummy test6.txt file ...

and changed this line:

$content = $content . "Content-Disposition: form-data; name=\"file\"; filename=\"c:\\temp\\test6.txt\"";

Any idea?


Lex

permanent link
Alex Ng (11) | answered May 02 '11, 2:04 p.m.
Hi Yuhong,

I'm getting error 415 when I run it in my schema:

status = 415 Unsupported Media Type

I used Windows to create a dummy test6.txt file ...

and changed this line:

$content = $content . "Content-Disposition: form-data; name=\"file\"; filename=\"c:\\temp\\test6.txt\"";

Any idea?


Lex

permanent link
Yuhong Yin (25123) | answered Dec 22 '10, 11:17 a.m.
JAZZ DEVELOPER
Deleting an attachment is not supported yet through the CQ OSLC interface. You should get "405 Method Not Allowed" if you do a "DELETE" to the attachment context.

Thanks

- Yuhong

Yuhong Yin
CC/CQ CM Server & Integrations

permanent link
Ana Ana (31111) | answered Dec 20 '10, 11:39 a.m.
Hi Yuhong,

Thanks for getting back with description fix. It worked like a charm. I have one more favor to ask, how can I delete a attachment through the perl code? I am not sure what URI to use. I tried couple of them and they bombed out with error 405.

Thank you for your help,
Ana

permanent link
Yuhong Yin (25123) | answered Dec 17 '10, 3:48 p.m.
JAZZ DEVELOPER
Hello

I missed two lines that are required to get the description set.

Please add the following lines right after my $content = "\r\n" and before the description line.

$content = $content . "--UdCwYxcWhVYyLPJCRxQTEowAxgcepp";
$content = $content . "\r\n";

I have double checked that with this, the description is correctly set.

Please note, if you run the script second time against the same record, you need to change the filename to a different one.

Thanks

- Yuhong

Yuhong Yin
CC/CQ CM Server and Integrations

permanent link
Ana Ana (31111) | answered Dec 17 '10, 12:30 p.m.
Yuhong,

Thank you so much. Couple of typos got me the error. But description is not being added (hope code is not checking the value agianst a typo :D ).

Skybanter,

You have a typo in your code in the uri. You used Attachements instead of Attachments, extra e in the middle. That should fix your code.

(I am checking your script) but here is the output when I ran my script.

>perl jazz_sample_oslc_attachmentTest.pl

Connecting to ClearQuest ...
URL = http://qwin115.ratl.swg.usma.ibm.com:12080/cqweb/oslc/repo/7.0.0/db/SAMPL

Connected to Clearquest.

Modifying ClearQuest Record by adding an attachment
post context = http://qwin115.ratl.swg.usma.ibm.com:12080/cqweb/oslc/repo/7.0.0/
db/SAMPL/record/16777224-33554479/field/Attachments/attachment


Record modified successfully!


Thanks

- Yuhong

Yuhong Yin
CC/CQ CM Server & Integrations

permanent link
Kevin Johnson (26) | answered Dec 16 '10, 9:52 p.m.
Hi Yuhong,

My description field is not being set. Do you see the same behavior?

Thanks!

permanent link
Kevin Johnson (26) | answered Dec 16 '10, 4:38 p.m.
Hi Yuhong,

Your script works beautifully! Thanks so much for all your effort with me and Ana.

Now I just need to figure out why my original one does not (yet) work.

Thanks Again!!!

permanent link
Yuhong Yin (25123) | answered Dec 16 '10, 3:51 p.m.
JAZZ DEVELOPER
(I am checking your script) but here is the output when I ran my script.

>perl jazz_sample_oslc_attachmentTest.pl

Connecting to ClearQuest ...
URL = http://qwin115.ratl.swg.usma.ibm.com:12080/cqweb/oslc/repo/7.0.0/db/SAMPL

Connected to Clearquest.

Modifying ClearQuest Record by adding an attachment
post context = http://qwin115.ratl.swg.usma.ibm.com:12080/cqweb/oslc/repo/7.0.0/
db/SAMPL/record/16777224-33554479/field/Attachments/attachment


Record modified successfully!


Thanks

- Yuhong

Yuhong Yin
CC/CQ CM Server & Integrations

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.