nfeed JSON WebService Select List labels

Simon Bear May 8, 2013

I'm using the nfeed JIRA plugin to get values for a Select List via a simple JSON web service. The data returned from the URL looks like:

[
{"class":"country.list.Country","id":1,"countryCode":"AF","countryName":"AFGHANISTAN"},{"class":"country.list.Country","id":2,"countryCode":"AX","countryName":"ÅLAND"},{"class":"country.list.Country","id":3,"countryCode":"AL","countryName":"ALBANIA"},...
]
I've set the URL to point the JSON service and the Select List gets populated with <options> that all look like the following:
<option value="country.list.Country">country.list.Country</option>
 
If I change the Key setting in nfeed (to 1 or 2) I can change the value attribute in the <option>, but I can't see how I can change the user visibile label on the <option>.
 
I've tried setting the "Rendering for * view" fields to {3} or 3, with and without the native filter option enabled but to no avail.  Nothing I've tried will change the labels in the Select List.  
The "Query for search summary" and other "Query..." options might be relevant but I'm not sure how one would use them to select an entry from a JSON object, and all the examples talk about SQL queries so they're of little help.
Is there something I've missed?
 

1 answer

1 accepted

1 vote
Answer accepted
Cyrille Martin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2013

Hi Simon,

For the moment the integration with the webservice is quite simple. The "select list" displays the first information provided in the JSON file, in your case "country.list.Country"

To obtain the list of country in the select list your JSON file has to be like this:

[
{"countryName":"AFGHANISTAN","class":"country.list.Country","id":1,"countryCode":"AF"},{"countryName":"ÅLAND","class":"country.list.Country","id":2,"countryCode":"AX"},{"countryName":"ALBANIA","class":"country.list.Country","id":3,"countryCode":"AL"},...
]

The key will be 2

You should apply the "Native filter"

and in the render HTML you can display {0} ({3})

The capability to display in the select list any properties could be great.

You can create an improvement on our JIRA

Regards

Cyrille

Simon Bear May 14, 2013

Thanks Cyrille, it would be nice to be able to customise. In this case we can change the output order but we have some other services we'd like to use which we'll need to proxy or similar to achieve this :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events