Unable to fetch the list of allowed values for Defect attribute i.e priority, severity of type Enumeration .
I have following configurations:
Jazz Server with RTC 4.0.3
I am working with the REST API of RTC 4.0.3 and trying to fetch the list of allowed values of the attributes of type enumeration i.e severity, priority or any custom enum type through the Java Client.
As per the REST API documentation i am able to fetch the Resource Shape details for the creation factory of the type defect.
It shows the RDF/XML data like this:
<oslc:property> <oslc:Property rdf:about="https://localhost:9443/ccm/oslc/context/_xE9Ycmk-EeOkI5-xWTQ7Fw/shapes/workitems/defect/property/internalSeverity"> <dcterms:title rdf:parseType="Literal">Severity</dcterms:title> <oslc:readOnly rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</oslc:readOnly> <oslc:representation rdf:resource="http://open-services.net/ns/core#Either"/> <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource"/> <oslc:allowedValues> <oslc:AllowedValues rdf:about="https://localhost:9443/ccm/oslc/context/_xE9Ycmk-EeOkI5-xWTQ7Fw/shapes/workitems/defect/property/internalSeverity/allowedValues"> <oslc:allowedValue rdf:resource="https://localhost:9443/ccm/oslc/enumerations/_xE9Ycmk-EeOkI5-xWTQ7Fw/severity/severity.literal.l2"/> </oslc:AllowedValues> </oslc:allowedValues> <oslc:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">severity</oslc:name>
<oslc:defaultValue rdf:resource="https://localhost:9443/ccm/oslc/enumerations/_xE9Ycmk-EeOkI5-xWTQ7Fw/severity/severity.literal.l3"/>ore#Exactly-one"/>
</oslc:property>
Here i can see the tag : "oslc:allowedValue" which will list the allowed values for the attribute priority which is showing the single value only
</oslc:AllowedValues>
But when i am seeing the RTC Web UI i am able to see the all the 4 items in the drop down box.
Question : 01 Why i am unable to fetch the all the enum values for the attribute of type enum(i.e severity) from the resource shape of the creation factory?
Question :02 When i have set the external value from the enumeration settings as shown in the below snapshot , it starts showing the list in the allowed values field in the resource shape . Why is it like this?
Any pointer regarding this issue will we highly appreciated.
Thanks & Regards,
Rahul
7 answers
Q: Are you able to fetch the all allowed values after removing the External Value for any enum type attribute?
A: yes
Q: why should i provide these external values? it's even not mandatory to add.
A: you don't need to provide them - https://jazz.net/library/article/1003
External values can be used for accessing attributes via RTC's REST API, such as the OSLC implementation.
Thanks for your answer!
As per my question:02 If i don't set the External Value for the severity via settings -> Manage Project Area ->Workitem -> Enumerations -> choose the severity enum for edit -> Delete the External values if set
Now i am not able to fetch the list of the allowed severity values via the URL
https://localhost:9443/ccm/oslc/context/_xE9Ycmk-EeOkI5-xWTQ7Fw/shapes/workitems/defect/property/internalPriority/allowedValues
It shows me only one default value
Are you able to fetch the all allowed values after removing the External Value for any enum type attribute?
And why should i provide these external values? it's even not mandatory to add.
Thanks & Regards,
Rahul
Sorry for the mismatch screen shots between the priority and severity and thanks again for the explanation.
I have tried with a new project area.
When i have tried to fetch the value of enum it works perfect and displaying the all allowed value.
Now i have set the external value for the enum.
This also gives me all the allowed values.
Now i have removed the External Values for the enum and here the issue is:
It gives me the only one value
For Severity
https://localhost:9443/ccm/oslc/enumerations/_lybzUo41EeOWAuxJalNJdg/severity/severity.literal.l1For Priority
https://localhost:9443/ccm/oslc/enumerations/_lybzUo41EeOWAuxJalNJdg/priority/priority.literal.l01As per your answer It should display the allowed values, but in my case the issue is still reproducible .
Thanks & Regards,
Rahul
Comments
I have encountered this issue as well, so far with RTC 4.0.0.2 and 4.0.6 but not with 5.0.x versions.
When no external value is set, internalSeverity and internalPriority only return a single allowed value (ie priority.literal.l01). Once external values are set, the allowed values start showing up in the resource shape, but if the external values are removed, they disappear again.
Rahul, were you ever able to find a solution for this problem?
Hi Rahul,