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

Using the REST API from curl, with RTC 4.0, how can I add a URL to a related Artifact?

I would like to get a Perl script using curl to work and your advice would be appreciated, dear reader!
I think I have something wrong with my REST API URL that I'm passing to curl...

Using the article here:

http://www.ibm.com/developerworks/rational/library/10/integrate-perforce-with-rational-team-concert/index.html

I got the Perl script from that article and am trying to code my Perl as:

    $cmd = "$curl -k -L -b $cookie -c $cookie -H \"Accept: application/json\" ".
        "-H \"Content-Type: application/json\" ".
        "-d \"{\\\"rdf:resource\\\":\\\"$cl_url\\\",".
        "\\\"oslc_cm:label\\\":\\\"link for change list:${c_id}\\\"}\" ".
        "https://${jazz}/jazz/oslc/workitems/${w_id}/".
        "rtc_cm:com.ibm.team.workitem.linktype.relatedartifact.relatedArtifact";

WHERE:
 - $cl_url is a string that gives the URL via p4web to the changelist
 - $c_id is the changelist number
 - $w_id is the work item id of the item in RTC to which I want to add the link
...etc...

when I try this against RTC 4.0.x - no link appears on the work item.

My theory is that the REST API has changed from the version the article was written against, vs. the 4.0.x server I'm playing on.

In any case, I just want it to work and your advice is appreciated!

0 votes


Accepted answer

Permanent link
change the OSLC URL from

https://${jazz}/jazz/oslc/ ...

to

https://${jazz}/ccm/oslc/...

the web server context name has changed from  RTC 2 to RTC 3 and later

Sam

Bill Rassieur selected this answer as the correct answer

0 votes

Comments

note that the best thing to do to debug these kinds of scripting problems is the hand code the URL til you get it to work.

https://server/jazz will fail right away.

Sam, Nice to hear from you!
I've shown my appreciation of your response by accepting this as the needed answer.


One other answer

Permanent link
Hi Bill, you may want to take a look at the OSLC 2.0 Specification. The page also demonstrates with multiples examples.

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
× 10,952
× 481

Question asked: Jun 27 '13, 11:33 a.m.

Question was seen: 7,840 times

Last updated: Jun 27 '13, 1:53 p.m.

Confirmation Cancel Confirm