Just putting this out there in case someone else is running into the same issue.
I have a form (external to Jira) that creates Jira tickets via email. While I can set some fields directly (using JEMH), multi-selection fields like checkboxes don't work, so those types form questions typically are just mapped to the description. My goals was to parse the description and set the appropriate values in the checkbox field. It was simple enough to isolate the values using .substringBefore and .substringAfter and then creating a list using .split. But I could never get the checkbox field to update correctly. I sifted through many answers here that were close, but never quite got there.
Eventually I stumbled upon this:
My data was separated by new lines "\n" inside a table cell and not commas, but it was exactly what I needed.
Set the variable {{formCheckboxes}}
{{description.substringAfter("|*Checkbox*|").substringBefore("|\n|*Next Question").trim().replace("\n","\"},{\"value\": \"").concat("\"} ]").reverse().concat("\" :\"eulav\"{ [").reverse()}}
Then the JSON for the edit was then simple:
{
"fields": {
"customfield_12345": {{formCheckboxes}}
}
}
Hope this helps someone, I was beating my head on the wall.
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Jira Administrator
Configure Jira Software, Jira Core, or Jira Service Management, including global settings, permissions, and schemes.
Managing Jira Projects Cloud
Learn to create and configure company-managed projects in Jira Software and partner effectively with Jira Admins.
Learning Path
Become an effective Jira Software Project Admin
This learning path is designed for team leaders who configure Jira Software projects to match a team's processes.