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
Improve user experience across Jira with global settings
Learn how to set up and configure a Jira site, manage Jira permissions, and configure Jira apps and integrations.
Learning Path
Streamline projects across Jira with shared configurations
Build Jira work items with reusable configurations called schemes, and reduce administrative work with automation.
Learning Path
Become an effective Jira software project admin
Set up software projects and configure tools and agile boards to meet your team's needs.