Hope this question finds you all well.
I have a map like this
def maps =
[
"hello": ["1", "2", "3"],
"goodbye": ["4", "5", "6"]
]
By referring Map.Find, I tried to get the key hello by using value in the value array, for example string "2", but it did not return anything.
Here are what i have tried so far
def wishKey = maps.find{it.value == "1"}.key
def wishKey = maps.find{it.find{it.value == "1"}}.key
def wishKey = maps.find{it.find{it["1"]}.key
def wishKey = maps.find{it.value.find{it["1"]}.key
Is there something that I missed?
Any pointers would be great!
Additional Info: I'm trying to achieve this in JIRA ScriptRunner in their ScriptEditor using Behaviour Script.
While the maps are hardcoded because I'm trying to compare the value of a key with a value that I get from a custom field dropdown.
I have confirmed that the custom field dropdown value is java.lang.String.