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

using perl LWP for accesing ResourceOrientedWorkitemAPI

Dear Friends,

I have been trying to resolve following requirement

"Identify the workitems that has been fixed/delivered on a particular stream and find whether the workitem is created by internally by qa team or externally for customers (field defect)"

As i see there are two parts

1) Gather the workitems that has been delivered to a stream using baseline comparision or some methodology
2) For each of the above workitem query using REST API to find out whether the workitem is created internally or externally

First is there a best way to accomplish above requirements.

Second, For point (2), I tried to use perl LWP module, but it does not give the xml, rather it is gives some html output as shown below. Any help is appreciated

Thanks & Regards,
Aruljothi.S

<DOCTYPE>

<Licensed>

<html>

<head>
<meta>
<meta>
<title>Loading...</title>

<link>


<link></link>

<style>
#net-jazz-ajax-NoScriptMessage {
width: 100%;
color: #D0D0D0;
font-size: 2em;
text-align: center;
position: absolute;
top: 45%;
z-index: 999;
}
</style>

<if>
<style>
body {
width: expression(documentElement.clientWidth < 860 ? "860px": "" );
}
</style>
<endif>

</head>

<body>
<noscript><div>Javascript is either disabled or not available in your Browser</div></noscript>
<div>Loading...</div>
<div></div>

<script>
djConfig = {isDebug: false, usePlainJson: true, baseUrl: "/jazz/web/dojo/"};
net = {jazz: {ajax: {}}};
net.jazz.ajax._contextRoot = "/jazz";
net.jazz.ajax._webuiPrefix = "/web/";
</script>

<script></script>

<script>
dojo.require("net.jazz.ajax.ui.PlatformUI");
</script>

<script>
/* <CDATA> */
</script>



<script>
/* <CDATA> */
</script>
</body>
</html>

0 votes



3 answers

Permanent link
Following is the perl script i used

use LWP::UserAgent;
use HTTP::Request;
use Data::Dumper;
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(GET => 'https://rtcserver:9443/jazz/oslc/workitems/15137.xml');
$req->authorization_basic('user','password');
$req->header('Accept' => "text/xml");
$ua->agent('Mozilla/5.0');
my $res = $ua->request($req);
# Check the outcome of the response
if($res->is_success) {
print $res->content;
}
else {
print $res->status_line, "\n";
}

0 votes


Permanent link
Hi Aruljothi,
I'm having the same problem, but for me it's when I retrieve the Project Areas doc from the URI specified in the CCM Root Services doc https://<server>:9443/ccm/process/project-areas. 
Curiously this worked fine until I was obliged to restart my machine for Windows updates!  Before that the expected XML was returned, today I get an HTML page very similar to the one you describe.

Did you find a way round this problem?

0 votes


Permanent link
No worries, I managed to answer it myself :o)

0 votes

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

Question asked: Dec 15 '10, 6:57 a.m.

Question was seen: 4,535 times

Last updated: Apr 28 '16, 11:02 a.m.

Confirmation Cancel Confirm