Creating workitem in RTC using OSLC
Hi,
Is there any sample code for creating a workitem in RTC using OSLC. I understand that it is to be done using creation factory, but need some help on the approach.The OSLC workshop pdf does not have code for creating workitems.
Thanks
Lipi
5 answers
I've seen a full example with source code but can't seem to locate it. Here's an example of doing the same thing using REST.
I I always get Http 405 Method Not allowed error during workitem creation with Java or Firefox Poster.
I POST to https://wat01ibmclm:9443/ccm/oslc/contexts/_Kw3GkmJHEeODZojFwTfvdw/workitems
<oslc_cm:ChangeRequest
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rtc_cm="https://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/">
<dc:title>A new Bug</dc:title>
<dc:description>This is new bug</dc:description>
<dc:type rdf:resource="https://wat01ibmclm:9443/ccm/oslc/types/_Kw3GkmJHEeODZojFwTfvdw/task"/>
</oslc_cm:ChangeRequest>
I POST to https://wat01ibmclm:9443/ccm/oslc/contexts/_Kw3GkmJHEeODZojFwTfvdw/workitems
<oslc_cm:ChangeRequest
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rtc_cm="https://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/">
<dc:title>A new Bug</dc:title>
<dc:description>This is new bug</dc:description>
<dc:type rdf:resource="https://wat01ibmclm:9443/ccm/oslc/types/_Kw3GkmJHEeODZojFwTfvdw/task"/>
</oslc_cm:ChangeRequest>
I am getting a HTTP/1.1 302 Moved Temporarily error message when I am trying to post a defect on the factory url through code.
I am however able to create defects using poster and restclient plugin in Firefox using the same content
Comments
Does your factory URL looks like mine? https://wat01ibmclm:9443/ccm/oslc/contexts/_Kw3GkmJHEeODZojFwTfvdw/workitems
Comments
Karthik Krishnan
Dec 12 '13, 5:17 a.m.I have some but not using factories but OSCL 1.0 way. If you need I could share
Lipi Das
Dec 12 '13, 5:24 a.m.Hi Karthik,
It would be helpful if you could share your approach as well.
Thanks
Lipi
Karthik Krishnan
Dec 12 '13, 5:24 a.m.I have some on OSCL 1.0 and not using Factories. If that's OK for you I can share my implementation
Lipi Das
Dec 12 '13, 5:28 a.m.Hi Karthik,
That is ok.
Thanks
Lipi
Karthik Krishnan
Dec 13 '13, 12:52 p.m.I typed a lengthy answer unfortunately the Jazz.net did not post it :( I will try & reply over the weekend
Lipi Das
Dec 19 '13, 3:50 a.m.I am getting a HTTP/1.1 302 Moved Temporarily error message when I am trying to post a defect on the factory url through code.
I am however able to create defects using poster plugin in Firefox using the same content