I have a variable (mylist) with list such as 50810, 50811 which is populated from a web request.
I was able to convert it into an array like ["50810", "50811"] using .asJsonStringArray
Ultimately, I want to convert it into JSON object like [{ "mykey" : "50810"}, {"mykey" : "50811"}] so I can update a custom multi select field.
I tried to chain asJsonObject("mykey") but it is giving me JSON as [{ "mykey" : "["50810", "50811"]"}] instead.
I am guessing I need to create a new variable and iterate over mylist and format it the way I want but I am drawing blank.
Can someone please share if what I want is possible, if so, maybe share some example of how this could be achieved.
I think this could solve my other problem of updating labels I asked here --> https://community.atlassian.com/t5/Automation-questions/Advanced-Field-Editing-Add-Remove-labels-using-variable-smart/qaq-p/2551263