[RESOLVED] Create Work Task Work Item via OSLC
I am using the Firefox Plugin, RESTClient, to attempt to create an out of the box work item of type task. Here are my details.
I am using the creation URL: https://domain.com/ccm/oslc/contexts/_VZV2ULQuEeKCua2t-np-3w/workitems/task I am using the "PUT" method PUT Headers Content-Type: application/rdf+xml OSLC-Core-Version: 2.0 Request Body: <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rtc_ext='http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/' I am receiving the following error: <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:oslc="http://open-services.net/ns/core#"> |
Accepted answer
I have found the problem:
Rosa Naranjo selected this answer as the correct answer
Comments
Canberk Akduygu
commented Dec 19 '13, 2:36 a.m.
I tried this but didnt work.
|
2 other answers
If you are using latest Rational Team Concert (e.g. V4.0.3), another header is required.
'X-Jazz-CSRF-Prevent' = 'JSESSIONID' JESSIONID can be obtained from cookie file. Cut and Paste the value (from FireFox cookie), then put this value into header. This change was introduced to prevent Cross site request forgeries (CSRF). |
I don't think the previous answers are helpful, you need enclosing rdf:description tag around the title, description and filedAgainst data, in a lot of project areas you need a filedAgainst because you will only be able to write to particular team categories, the wiki and answers in this forum in regard to creating work items via OSLC seem either wrong or out of date. Hopefully this answer will help someone else, I spent a considerable time getting it wrong when all I needed was an enclosing rdf:description tag. The following should create a work item with summary, description and filedAgainst, you will need to replace filedAgainst for it to work for you, or delete it and try it in an unlocked down project area
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:acp="http://jazz.net/ns/acp#" xmlns:oslc="http://open-services.net/ns/core#" xmlns:oslc_cmx="http://open-services.net/ns/cm-x#" xmlns:process="http://jazz.net/ns/process#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:oslc_cm="http://open-services.net/ns/cm#" xmlns:acc="http://open-services.net/ns/core/acc#" xmlns:oslc_pl="http://open-services.net/ns/pl#" xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" xmlns:rtc_ext="http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/" > <rdf:Description> <dcterms:title rdf:parseType="Literal">Test from Powershell</dcterms:title> <dcterms:description rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral">Note that this will increase the complexity of the tool a fair bit.</dcterms:description> <rtc_cm:filedAgainst rdf:resource=https://YourServer/ccm/resource/itemOid/com.ibm.team.workitem.Category/yourId/> </rdf:Description> </rdf:RDF> |
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.
Comments
I have changed my POST data to:
I'm also getting this exact same error doing the exact same thing.
dcterms:title is the Summary attribute isn't it?
Get a 403 forbidden error all headers seem ok, I'm definitely getting through to RTC, it just doesn't like some formatting, so I get what appears to be a bogus error
Can anyone help, bit stuck ;-(