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

How to discover user defined attributes using REST API

I am trying to create a new workitem following the examples shown in:

https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2

In our system there is a new attribute that is required to create the new workitem.

when I look an existing workitem using:

curl -k -b $COOKIES "$HOST/oslc/workitems/2959.xml"


I see it looks like this:
<rtc_cm>


How do I use this information - or better yet - I do I discover the valid settings - to use in my version of create-simple.json?

{

"dc:title":"My first new work item",
"dc:description":"A description for the new work item",
"dc:type":"defect",
"rtc_cm:discovered_by":"Customer"
}


When I use a known good value for the discovered_by, it returns the error:

{

"oslc_cm:message": "Illegal value: Customer",
"oslc_cm:status": 409
}

0 votes



2 answers

Permanent link
I am trying to create a new workitem following the examples shown in:
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2
In our system there is a new attribute that is required to create the new workitem. When I look an existing workitem using:
curl -k -b $COOKIES "$HOST/oslc/workitems/2959.xml"

I see it looks like this:
<rtc_cm:discovered_by rdf:resource="https://localhost:9443/ccm/oslc/enumerations/_iDjGoDuwEeCpC8m1BEftMg/discovered_by/discovered_by.literal.l8"/>


How do I use this information - or better yet - I do I discover the valid settings - to use in my version of create-simple.json?
{

"dc:title":"My first new work item",
"dc:description":"A description for the new work item",
"dc:type":"defect",
"rtc_cm:discovered_by":"Customer"
}

When I use a known good value for the discovered_by, it returns the error:
{

"oslc_cm:message": "Illegal value: Customer",
"oslc_cm:status": 409
}

0 votes


Permanent link
I found my problems:

1. I was not using the correct context. My sample value came from a different project area, but I did not change it when trying to use the value returned by xml query.

<rtc_cm:discovered_by rdf:resource="https://localhost:9443/ccm/oslc/enumerations/_iDjGoDuwEeCpC8m1BEftMg/discovered_by/discovered_by.literal.l8"/>

2. When I did correct the project area, I did not notice the last part of the above is not one-eight, but ell-eight.

So, the suggestion to 'figure out a custom attribute: read back a workitem and see what the value is set to' does work. Still not discoverable, but in my case this can be hard coded to one of the four options fairly easily.

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

Question asked: May 10 '12, 2:58 a.m.

Question was seen: 4,417 times

Last updated: May 10 '12, 2:58 a.m.

Confirmation Cancel Confirm