It's all about the answers!

Ask a question

Unable to fetch the list of allowed values for Defect attribute i.e priority, severity of type Enumeration .

Rahul Singh Bhadauriya (2821720) | asked Feb 04 '14, 9:06 a.m.
edited Feb 04 '14, 9:10 a.m.
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 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="">true</oslc:readOnly>
<oslc:representation rdf:resource=""/>
<oslc:valueType rdf:resource=""/>
<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:name rdf:datatype="">severity</oslc:name>
oslc:defaultValue rdf:resource="https://localhost:9443/ccm/oslc/enumerations/_xE9Ycmk-EeOkI5-xWTQ7Fw/severity/severity.literal.l3"/>ore#Exactly-one"/>

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:allowedValue rdf:resource="https://localhost:9443/ccm/oslc/enumerations/_xE9Ycmk-EeOkI5-xWTQ7Fw/severity/severity.literal.l2"/>

But when i am seeing the RTC Web UI i am able to see the all the 4 items in the drop down box.
RTC Serverity Enum

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?

Enum Settings Priority

Any pointer regarding this issue will we highly appreciated.

Thanks & Regards,

7 answers

permanent link
Eric Jodet (6.3k5111120) | answered Feb 05 '14, 5:43 a.m.
  Hello Rahul,
not sure I follow you here.
In the above comment:
- OSLC request shows you look for internalPriority
- screen cap shows severity

In OOTB SCRUM PA - we don't have any external values both both attributes.

The doubt I have is about your concern / problem.
Are you saying:
1 - if I add external values to enum, then I can not fetch all values - but only get the default one
2 - if I remove external values to enum, then I can not fetch all values - but only get the default one
(which implicitly means - you are able to fetch values if you have external values)

As per your questions:

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 -
External values can be used for accessing attributes via RTC's REST API, such as the OSLC implementation.

Eric Jodet commented Feb 05 '14, 9:51 a.m.

 Hello Rahul,

so the difference between your env and my env is RTC version.
You are using 4.0.3
I am using 4.0.5

Any possibility for you to test 4.0.5?
Did you check ccm log and search for error?


permanent link
Eric Jodet (6.3k5111120) | answered Feb 04 '14, 11:01 a.m.
Hello Rahul,

I first fetched shapes (for defect):

Checked the XML, and found:
  <rdf:Description rdf:about="">
    <oslc:occurs rdf:resource=""/>
    <oslc:valueType rdf:resource=""/>
    <dcterms:title rdf:parseType="Literal">Priority</dcterms:title>
    <oslc:allowedValues rdf:resource=""/>
    <oslc:propertyDefinition rdf:resource=""/>
    <oslc:representation rdf:resource=""/>
    <oslc:name rdf:datatype="">priority</oslc:name>
    <rdf:type rdf:resource=""/>
    <oslc:defaultValue rdf:resource=""/>
    <oslc:readOnly rdf:datatype="">false</oslc:readOnly>

So I used:

and received:
    xmlns:oslc="" > 
  <rdf:Description rdf:about="">
    <rdf:type rdf:resource=""/>
    <oslc:allowedValue rdf:resource=""/>
    <oslc:allowedValue rdf:resource=""/>
    <oslc:allowedValue rdf:resource=""/>
    <oslc:allowedValue rdf:resource=""/>

Eric Jodet commented Feb 04 '14, 11:02 a.m.


permanent link
Eric Jodet (6.3k5111120) | answered Feb 04 '14, 11:04 a.m.
 So in your context:

should fetch all values.

Hope it helps,

permanent link
Rahul Singh Bhadauriya (2821720) | answered Feb 04 '14, 11:47 p.m.
Hi Eric,
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
Severity Edit

It shows me only one default value
  • <rdf:RDF
  • xmlns:rdf=""
  • xmlns:oslc="" >
  • <rdf:Description rdf:about="https:/localhost:9443/ccm/oslc/context/_xE9Ycmk-EeOkI5-xWTQ7Fw/shapes/workitems/defect/property/internalPriority/allowedValues">
  • <rdf:type rdf:resource=""/>
  • <oslc:allowedValue rdf:resource="https://localhost:9443/ccm/oslc/enumerations/_xE9Ycmk-EeOkI5-xWTQ7Fw/priority/priority.literal.l01"/>
  • </rdf:Description>
  • </rdf:RDF>
  • 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,


    permanent link
    Eric Jodet (6.3k5111120) | answered Feb 05 '14, 5:44 a.m.
     Here is what I tested, and what I fetched:
    OOTB - no external values
        <oslc:allowedvalue rdf:resource=""/>;
        <oslc:allowedvalue rdf:resource=""/>;
        <oslc:allowedvalue rdf:resource=""/>;
        <oslc:allowedvalue rdf:resource=""/>;

    with external values
        <oslc:allowedValue rdf:resource=""/>
        <oslc:allowedValue rdf:resource=""/>
        <oslc:allowedValue rdf:resource=""/>
        <oslc:allowedValue rdf:resource=""/>
    removed external values
    <oslc:allowedValue rdf:resource=""/>
        <oslc:allowedValue rdf:resource=""/>
        <oslc:allowedValue rdf:resource=""/>
        <oslc:allowedValue rdf:resource=""/>

    Eric Jodet commented Feb 05 '14, 5:45 a.m.

     which means:

    - we fetch external values if / when set
    - we fetch internal values if / when no external values set

    permanent link
    Rahul Singh Bhadauriya (2821720) | answered Feb 05 '14, 9:07 a.m.
    Hi Eric,
    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
    For Priority

    As per your answer It should display the allowed values, but in my case the issue is still reproducible .

    Thanks & Regards,

    Myles F commented Mar 06 '15, 5:21 p.m. | edited Mar 06 '15, 5:22 p.m.

    I have encountered this issue as well, so far with RTC 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?

    permanent link
    Sujith Babu Bandla (265) | answered Sep 05 '17, 9:13 a.m.

     Hi Rahul,

    Please try using this code 

    //Look at the allowed values for Priority. This is generally a required field for defects.
    Property PriorityProperty = shape.getProperty(new URI(""));
    if (PriorityProperty != null) {
    System.out.println("Inside not null property");
    URI allowedValuesRef8 = PriorityProperty.getAllowedValuesRef();
    ClientResponse allowedValuesResponse8 = client.getResource(allowedValuesRef8.toString(),OslcMediaType.APPLICATION_XML);
    AllowedValues allowedValues8 = allowedValuesResponse8.getEntity(AllowedValues.class);
    Object[] values8 = allowedValues8.getValues().toArray();
    for(Object val:values8) {
    System.out.println("The values of Priority literal are "+val);
    //If this fails, you might need to check that the value is not "Unassigned", which is an allowed value in some RTC project areas.
    //Try the second value instead of the first, most project area processes create more than one category
    defect1.getExtendedProperties().put(new QName("", "priority"), (URI) values8[2]);

    Sujith Babu

    Your answer

    Register or to post your answer.