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

How update RTC work item with enumeration list field by REST

Hello guys!
I found an unclear issue. I can not update an RTC work item which contains a multi value field created based on enumeration list attribute.
If I use a single enumeration, for example priority, so I can do GET request to this work item and define a real value like to:

<oslc_cm:priority rdf:resource="https://jazz.finecosoft.ru:9443/ccm/oslc/enumerations/_LbHV8FaWEeSZl8cZf7qI_w/priority/Critical"/>

In this case, I know that I will use the value in "rdf:resource" attribute to change the field value.
But what can I to do in case of multi value custom field. The value which I get with REST is like to:

<rtc_cm:com.finecosoft.components.field oslc_cm:collref="https://jazz.finecosoft.ru:9443/ccm/oslc/enumerations/_LbHV8FaWEeSZl8cZf7qI_w/enumerationList$com.finecosoft.components.enum"/>

I don't see the values which are set for this field. Please help me if it's possible to work with enumeration list by REST API.
Thank you very much in advance!

0 votes


Accepted answer

Permanent link
Hi Dmitry,

From what I see you can use the Firebug to check how it works, see the post:
https://jazz.net/forum/questions/135858/how-to-perform-particular-action-using-rest-api-in-clm-applications

Best regards,
Tad
Dmitry A. Lesin selected this answer as the correct answer

1 vote

Comments

Hi Tadeusz,

Thank you for your reference! I couldn't find it earlier.
Firebug shew me such POST data which I can reproduce in my code:

additionalSaveParameters    com.ibm.team.workitem.common.internal.updateBacklinks
attributeIdentifiers    com.finecosoft.components.field
attributeValues    ["com.finecosoft.components.enum.literal.l2","com.finecosoft.components.enum.literal.l4","com.finecosoft.components.enum.literal.l6","com.finecosoft.components.enum.literal.l8"]
itemId    _mcFNcFtuEeSOSZ_ecNriAA
projectAreaItemId    _LbHV8FaWEeSZl8cZf7qI_w
sanitizeHTML    true
stateId    _uD-9gFtvEeSOSZ_ecNriAA
type    com.finecosoft.workitem.type.requestbat

We can see a correct syntax in "attributeValues", and other useful data. I will return here soon for finalizing the investigation results.

1 vote

Hi Dmitry,

I added a simple example how use Firebug and Poster in situations like yours, please see the post:
https://jazz.net/forum/questions/166922/how-to-use-firebug-and-poster-to-find-and-test-rest-parameters-to-change-workitemss-in-rtc

Hi Tad,
Thank you for the reference above. To update such field with HTTP request in XML format (not JSON) I performed in accordance to OSLC CM v2.0:

1. Do GET request:

URL: https://<SERVER>:9443/ccm/oslc/workitems/136?oslc_cm.properties=rtc_ext:com.finecosoft.components.field

Headers:
OSLC-Core-Version: 2.0
Accept: application/rdf+xml
Content-Type: application/rdf+xml

Current screenshot for the custom field:


  1. Do PUT request:

    URL: the same

    Headers: the same
    and
    If-Match: 36d19b16-2364-3c38-aac6-176636921543
    This value is taken from Etag in response headers from GET request!

We can see at the next screenshot that the enumeration list is actually updated!


I believe this info could help to everybody who needs the details of updating the enumeration list fields with HTTP requests!

showing 5 of 10 show 5 more comments

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
× 479

Question asked: Oct 24 '14, 6:35 a.m.

Question was seen: 5,949 times

Last updated: Nov 25 '14, 2:24 p.m.

Confirmation Cancel Confirm