rtcclient icon indicating copy to clipboard operation
rtcclient copied to clipboard

Can't get enumeration list selected value

Open MartinBarkerPhilips opened this issue 3 years ago • 9 comments

Hello, I have an rtc custom work item with the field 'Design Authority" which is a check box of 5 options.

image

I checked my rtc settings, and i believe it is an enumeration list

image

But If i try to query for rtc_cm:DesignAuthority my rtc_client returns a list of values, with no way to determine which value was selected

image

I'm curious, is there a different way I can retrieve the selected value of this enumeration list? I checked the raw_data variable as well, and found out that it includes a URL which shows all the xml enumeration options, but still no way to determine which value the user has selected inside the work item

image

MartinBarkerPhilips avatar Jul 19 '22 20:07 MartinBarkerPhilips

But If i try to query for rtc_cm:DesignAuthority my rtc_client returns a list of values, with no way to determine which value was selected

I'm curious, is there a different way I can retrieve the selected value of this enumeration list? I checked the raw_data variable as well, and found out that it includes a URL which shows all the xml enumeration options, but still no way to determine which value the user has selected inside the work item

I think we could take a look at raw data of workitem. There should be some fields to indicate the selected data.

dixudx avatar Jul 20 '22 09:07 dixudx

The raw_data object does have an element for DesignAuthority, the field I am trying to get

image

if you go to the url, this is the contents of the page:

<oslc_cm:Collection oslc_cm:totalCount="5" xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/" xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/">
<rtc_cm:Literal rdf:resource="https://company:9443/ccm/oslc/enumerations/ADASDASDASDASDASDASD/enumerationList$DesignAuthority/DesignAuthority.literal.l3">
<dc:identifier>DesignAuthority.literal.l3</dc:identifier>
<dc:title>Unassigned</dc:title>
<rtc_cm:iconUrl/>
</rtc_cm:Literal>
<rtc_cm:Literal rdf:resource="https://company:9443/ccm/oslc/enumerations/ADASDASDASDASDASDASD/enumerationList$DesignAuthority/DesignAuthority.literal.l5">
<dc:identifier>DesignAuthority.literal.l5</dc:identifier>
<dc:title>Haifa</dc:title>
<rtc_cm:iconUrl/>
</rtc_cm:Literal>
<rtc_cm:Literal rdf:resource="https://company:9443/ccm/oslc/enumerations/ADASDASDASDASDASDASD/enumerationList$DesignAuthority/DesignAuthority.literal.l6">
<dc:identifier>DesignAuthority.literal.l6</dc:identifier>
<dc:title>Pune</dc:title>
<rtc_cm:iconUrl/>
</rtc_cm:Literal>
<rtc_cm:Literal rdf:resource="https://company:9443/ccm/oslc/enumerations/ADASDASDASDASDASDASD/enumerationList$DesignAuthority/DesignAuthority.literal.l2">
<dc:identifier>DesignAuthority.literal.l2</dc:identifier>
<dc:title>Shenyang</dc:title>
<rtc_cm:iconUrl/>
</rtc_cm:Literal>
<rtc_cm:Literal rdf:resource="https://company:9443/ccm/oslc/enumerations/ADASDASDASDASDASDASD/enumerationList$DesignAuthority/DesignAuthority.literal.l4">
<dc:identifier>DesignAuthority.literal.l4</dc:identifier>
<dc:title>Suzhou</dc:title>
<rtc_cm:iconUrl/>
</rtc_cm:Literal>
</oslc_cm:Collection>

Which has each option and link to each options resource, clicking link for the last option, 'Suzhou' leads to this

<rtc_cm:Literal rdf:about="https://company:9443/ccm/oslc/enumerations/_ASDASDADADAD/enumerationList$DesignAuthority/DesignAuthority.literal.l4" xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/">
<dc:identifier>DesignAuthority.literal.l4</dc:identifier>
<dc:title>Suzhou</dc:title>
<rtc_cm:iconUrl/>
</rtc_cm:Literal>

which doesnt have that much info about if it is selected or not, the url for the 'Prune' option which the work item has selected shows not that much data either:

<rtc_cm:Literal rdf:about="https://company.com:9443/ccm/oslc/enumerations/_ASDASDASDAD/enumerationList$DesignAuthority/DesignAuthority.literal.l6" xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/">
<dc:identifier>DesignAuthority.literal.l6</dc:identifier>
<dc:title>Pune</dc:title>
<rtc_cm:iconUrl/>
</rtc_cm:Literal>

MartinBarkerPhilips avatar Jul 20 '22 14:07 MartinBarkerPhilips

The 'kind' of item is a checkbox enumeration list image

in xml, there is only a oslc_cm:collref url

<rtc_cm:DesignAuthority oslc_cm:collref="https://company:9443/ccm/oslc/enumerations/_asdasdasdA/enumerationList$DesignAuthority"/>

MartinBarkerPhilips avatar Jul 20 '22 20:07 MartinBarkerPhilips

Is there any chance that the field 'Design Authority" is recorded in another work type instead of workitem? Would you help inspect the web browser to see if there are other requests related on "Design Authority".

dixudx avatar Jul 21 '22 03:07 dixudx

I confirm the issue is still there, workitem contains the full list but not selected one.

The attribute appear to be defined as enumerationList$<attribute_name> while the presentation uses "com.ibm.team.workitem.kind.enumerationListPicker" to set its values.

I have two cases with same issue that both are configured with enumerationListPicker as above, looking at project area definition I see:

  1. an "attributeDefinition" that has a "dependsOn"
<customAttribute id="<given_string>" name="..." type="enumerationList$<attribute_name>"/>
....
<attributeDefinition id="<given_string>" name="...." type="enumerationList$<attribute_name>">
    <dependsOn id="com.ibm.team.workitem.attribute.category"/>
</attributeDefinition>
<customAttribute id="<given_string>" name="..." type="enumerationList$<attribute_name>"/>

<valueSetProvider id="com.ibm.team.workitem.valueproviders.VALUE_SET_PROVIDER.<id>" name="..." providerId="com.ibm.team.workitem.common.internal.attributeValueSetProviders.FilteredValueSetProvider">
<mapping dependentEnumeration="<attribute_name>" sourceAttribute="category" sourceEnumeration="category">
<value content="...">
	<literal id="<enum_name>.literal.l10"/>
     ........
</value>
<value content=" ... ">
	<literal id="<enum_name>.literal.l10"/>
     ........
</value>
</mapping>
</valueSetProvider>

on work item, even if with full attributes, nothing refers to picker or value_set_provider. Is it possible that's managed by projectarea?

gpongelli avatar Apr 06 '23 15:04 gpongelli

Is it possible that's managed by projectarea?

Yeah, possibly. I did remember some of these features/settings are defined in standalone properties. It is very tricky.

The attribute appear to be defined as enumerationList$<attribute_name> while the presentation uses "com.ibm.team.workitem.kind.enumerationListPicker" to set its values.

Wow, I did not recognize this. It seems we need to insert a hard-coded by-pass to handle this property.

dixudx avatar Apr 07 '23 09:04 dixudx

The attribute appear to be defined as enumerationList$<attribute_name> while the presentation uses "com.ibm.team.workitem.kind.enumerationListPicker" to set its values.

Wow, I did not recognize this. It seems we need to insert a hard-coded by-pass to handle this property.

I noticed the $ character is present in those tricky cases.

gpongelli avatar Apr 07 '23 10:04 gpongelli

I noticed the $ character is present in those tricky cases.

That's really funny. 😂😂😂

dixudx avatar Apr 07 '23 11:04 dixudx

The attribute appear to be defined as enumerationList$<attribute_name> while the presentation uses "com.ibm.team.workitem.kind.enumerationListPicker" to set its values.

Let's get back to the track.

So shall we add a special snippet to handle this case? I don't know whether these attributes are worthy of doing that.

dixudx avatar Apr 07 '23 11:04 dixudx