How to keep the order of enumeration when updating a property with REST API
I have been able to use the REST API to update attributes in work items. So far this method is working fine
<url-of-workitem>?x-oslc-cm-change-request%2Bjson&oslc_cm.properties=rtc_cm:Fixed_Versions_EL and I pass a json object { "Fixed_Versions_EL": [ "1.0", "1.1", "1.2"] } This is working for all attributes, but I do have an issue with a field that is of type Enumeration List. In that case the order that I commit is not the one I see in the work item. For example the above request will show up as 1.1 , 1.0, 1.2 which is correct but not what I expected.. Is there a way to prevent this, how can I keep the order. ( our server is running 5.0.2 ifix012 ) |
Be the first one to answer this question!
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.
Comments
Enumeration list does not have an "order" if I understand correctly. It may well be how the values are presented, rather than how they are updated. What's the attribute presentation in the work item editor? How does it actually look?
A screenshot may help a lot but you have to attach it somewhere else due to your low reputation.
Thanks for getting back to me
so this is what I get when i post the change 8.8, 8.7, 8.6, from highest to lowest
The editor is defined like that
If I use the web editor, I am able to add each value in the order I want and this order is kept when i reopen a work item. I wish I could reproduce that when I edit with the REST api.
any suggestion?
What I found is that when using OSLC API, the enumeration list order appears to be the same as the IDs (smaller number first). It may be that the code actually does sort the enumerations first before updating. I have found no way to carry the order in the presentation.