Trying to have value with ampersand when using ValuesGenerator

Developing a report with a select element for users to configure and populating the select using ValuesGenerator. When the value has an ampersand, it looks like it is getting encoded twice so the end result is incorrect.

For example I add the following value to the Map that is returned from “getValues()”

valMap.put(“Z&Z”, “Z&Z”);

Here what is in the resulting HTML:

<option value=“Z&amp;Z”>Z&amp;Z</option>

And the value in the Select shows as Z&amp;Z

Hey Steve,
Are you able to give me a bit more information about how this Select element works? I’m having a difficult time understanding how this should work.

This is a Report Plugin (#16 from atlas-create-jira-plugin-module). This sets the values that the user can select when configuring a custom Report.

I modeled this after an example in the “Jira Development Cookbook - Third Edition” by Jobin Kuruvilla in the chapter titled “Writing a Jira Report” page 216

Hey, it looks like the Jira Development Cookbook examples apply for Jira 5, that’s probably quite outdated by now. I don’t actually have access to the book right now, but perhaps you’d be better off trying to use this Tutorial on as a starting point instead?

To clarify, I was wondering how the value Z&Z was corresponding to a select statement for your report? What data were you trying to select? A text search? Projects etc?


Thanks for looking this. I looked at that tutorial - it links to this page:
On that page, it says: "Values can be provided by a value provider class that must subclass com.atlassian.configurable.ValuesGenerator"

That’s what I do in my use case, but I’m seeing ampersands get encoded.

To be specific, Z&Z is a test value that I’ve been using. The class I use (subclass of ValuesGenerator) pulls (non-disabled) values from a different custom field. I simplified the example because the source of the field options appear to be irrelevant.