How to create a Task WorkItem using OSLC 2.0
One answer
With OSLC refer - https://jazz.net/forum/questions/124269/resolved-create-work-task-work-item-via-oslc
With Java API --> Refer this blog https://rsjazz.wordpress.com/ by @ralphschoon You will find lots of examples
Comments
Hi Karthik,
I tried using Rest Client.
URL : https://localhost:9443/ccm/oslc/contexts/_7zrIUNj9EeS7ButJuJdZ2w/workitems/task
Added the Headers.
I did PUT
Its not working.
405 Method Not Allowed
Body :
<rdf:rdf xmlns:rtc_ext="http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/"
xmlns:dcterms='http://purl.org/dc/terms/'
xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:oslc='http://open-services.net/ns/core#'
xmlns:oslc_cm='http://open-services.net/ns/cm#'
xmlns:rtc_cm='http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/'
xmlns:oslc_cmx='http://open-services.net/ns/cm-x#'>;;
<oslc_cm:changerequest xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:oslc_disc="http://open-services.net/xmlns/discovery/1.0/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/"
xmlns:jp="http://jazz.net/xmlns/prod/jazz/process/1.0/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:oslc_qm="http://open-services.net/xmlns/qm/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
xmlns:jd="http://jazz.net/xmlns/prod/jazz/discovery/1.0/"
xmlns:oslc_rm="http://open-services.net/xmlns/rm/1.0/">
<dcterms:title>Test Task Work Item from OSLC</dcterms:title>
</oslc_cm:changerequest>
</rdf:rdf>
To avoid the "405 Method not allowed" error, you need to add a proper "Accept" header.