It's all about the answers!

Ask a question

cannot create a workitem with custom properties using OSLC


Satoshi Tanaka (311210) | asked Oct 14 '11, 8:22 a.m.
Hi,
I'm facing an error 400 bad request, so I was not able to create a new workitem with custom properties (rtc_ext:foo) using OSLC.
If I don't use custom properties (rtc_ext:foo) , it works fine.

Could you please tell me how to create a new workitem with custom properties (rtc_ext:foo)? Thank you.

the XML which I've posted is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<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:identifier></dcterms:identifier><dcterms:title>dadsadd</dcterms:title><dcterms:description></dcterms:description><oslc_cm:status></oslc_cm:status><dcterms:modified></dcterms:modified><rtc_cm:due></rtc_cm:due><dcterms:type rdf:resource='task' />
<rtc_ext:plannedDuration>5</rtc_ext:plannedDuration>
</oslc_cm:ChangeRequest>
</rdf:RDF>

4 answers



permanent link
Rosa Naranjo (2.9k11723) | answered Oct 14 '11, 2:07 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hello
I was able to post to my creationfactory URI and create a workitem in my sample JUnit project with the following request body:


<?xml version="1.0" encoding="UTF-8"?>
<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>rosa</dcterms:title>
<rtc_cm:type rdf:resource="https://jazz.server.com:9443/ccm/oslc/types/_7GuT8OSYEeCkne6xl9aEDw/defect"/>
<rtc_cm:filedAgainst rdf:resource="https://jazz.server.com:9443/ccm/resource/itemOid/com.ibm.team.workitem.Category/_-x3I8OSYEeCkne6xl9aEDw"/>
<oslc_cm:status>New</oslc_cm:status>
<rtc_ext:specialcustom>hello</rtc_ext:specialcustom>
</oslc_cm:ChangeRequest>
</rdf:RDF>


In my example, my rtc custom attribute is called 'specialcustom', so it appears in the request body as follows:
<rtc_ext:specialcustom>hello</rtc_ext:specialcustom>

Make sure you are posting to the creation factory URI for your CCM project as returned by your service provider resource document and use the folllowing headers: OSLC-Core-Version=2.0, accept=application/xml and Content-Type=application/xml

permanent link
Scott Russell (4688) | answered Oct 14 '11, 3:43 p.m.
Hi,
I'm facing an error 400 bad request, so I was not able to create a new workitem with custom properties (rtc_ext:foo) using OSLC.
If I don't use custom properties (rtc_ext:foo) , it works fine.

Could you please tell me how to create a new workitem with custom properties (rtc_ext:foo)? Thank you.


What do you get when you get for the foo field when you do a look-up? If it's a reference URI (and not a literal value), than that's what it'll expect during creation too.

permanent link
Satoshi Tanaka (311210) | answered Oct 14 '11, 6:25 p.m.
Hello, Thank you for your prompt reply.

Fortunately, I was able to create a new workitem. I used just 'task' for dcterms:type. however, after specifying appropriate full url for this property, I was able to create a new workitem. Thank you so much.

permanent link
Satoshi Tanaka (311210) | answered Oct 14 '11, 6:27 p.m.
Hi,
I'm facing an error 400 bad request, so I was not able to create a new workitem with custom properties (rtc_ext:foo) using OSLC.
If I don't use custom properties (rtc_ext:foo) , it works fine.

Could you please tell me how to create a new workitem with custom properties (rtc_ext:foo)? Thank you.


What do you get when you get for the foo field when you do a look-up? If it's a reference URI (and not a literal value), than that's what it'll expect during creation too.

I got the following error:
"400 Bad Request" and "work item type is not found" because I specified wrong url for this type. Thank you so much.

Your answer


Register or 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.