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

cannot create a workitem with custom properties using OSLC

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>

0 votes



4 answers

Permanent link
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

0 votes


Permanent link
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.

0 votes


Permanent link
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.

0 votes


Permanent link
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.

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,982

Question asked: Oct 14 '11, 8:22 a.m.

Question was seen: 6,850 times

Last updated: Oct 14 '11, 8:22 a.m.

Confirmation Cancel Confirm