Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get enumeration list selected value #167

Open
MartinBarkerPhilips opened this issue Jul 19, 2022 · 9 comments
Open

Can't get enumeration list selected value #167

MartinBarkerPhilips opened this issue Jul 19, 2022 · 9 comments

Comments

@MartinBarkerPhilips
Copy link

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

@dixudx
Copy link
Owner

dixudx commented Jul 20, 2022

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.

@MartinBarkerPhilips
Copy link
Author

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
Copy link
Author

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"/>

@dixudx
Copy link
Owner

dixudx commented Jul 21, 2022

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".

@gpongelli
Copy link
Collaborator

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?

@dixudx
Copy link
Owner

dixudx commented Apr 7, 2023

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.

@gpongelli
Copy link
Collaborator

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.

@dixudx
Copy link
Owner

dixudx commented Apr 7, 2023

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

That's really funny. 😂😂😂

@dixudx
Copy link
Owner

dixudx commented Apr 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants