My problem is pretty simple. I want a pull-down for states, and a pull-down for counties within the state (US states for this example) within a JIRA issue that updates when the state changes. I can get a json blob of the county-to-state maps that looks something like this:
[
{
stateName: "Texas",
stateAbbr: "Tx".
counties: [ "Anderson", "Andrews", Angelina",...]
}
{
stateName: "Oklahoma",
stateAbbr: "Ok",
counties: [ "Adair", "Alfalfa", "Atoka",...]
}
...
]
Obviously I've got all the counties, etc. in there. I've got a Adaptavist Script Runner plugin that pulls the list of states (some projects/issue types maybe use other countries, etc.), but how do I get the list of the counties to update when the state changes?
I'd prefer to have one call up-front when the JIRA issue creation screen loads instead of calls on the backend when people select different states. I can easily store all the states and counties in memory if I know how/where to get them.
Yes, this is a contrived example, but it represents a real problem. A "state/county" plugin isn't what I actually need. Groovy code that let's me save the counties for each state in a map and have the county choices update when the state changes is what I'm after. Thanks for any help you can provide.