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

How to update RTC resources with OSLC?

Hi,

I'm trying to add/update comments and subscribers of work items in Rational Team Concert v4.x programmatically using Lyo OSLC with Perl but though able to update properties such as summary and description fields, the workitemUpdate subroutine doesn't seem to do the same with collections.
My guess is that it is due to the hardcoded base URI (resource/itemName/com.ibm.team.workitem.WorkItem) referring to work item properties so I tried PUTting the request directly to the comments collref URL of a given work item with below code.

use strict;
use warnings;
use XML::Simple;
use Lyo::OSLC::RTC::CM;

my $oslcclient = Lyo::OSLC::RTC::CM->new;

$oslcclient->credentials('user', 'password');
$oslcclient->setBaseURI('https://localhost:9443/ccm');
$oslcclient->debugging(1);

my $uri = 'https://localhost:9443/ccm/oslc/workitems/_NjDuMOpLEeOOrbZsRN6NKA/rtc_cm:comments';
my $new = '{"dc:description": "My new comment"}'; 

$oslcclient->GET($uri);

my $ETag = $oslcclient->responseHeader('Etag');

$oslcclient->PUT($uri, $new,
{
'If-Match' => $ETag,
'Accept' => 'text/json',
'Content-Type' => 'application/x-oslc-cm-change-request+json',
}
);

exit 1;

0 votes


Be the first one to answer this question!

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,936
× 515
× 10

Question asked: Jun 06 '14, 11:59 a.m.

Question was seen: 5,811 times

Last updated: Jun 06 '14, 12:40 p.m.

Confirmation Cancel Confirm