Hi!
I'm currently writing a script to auto-populate the description field with info-paneled text on a specific ticket type, using the script runner "behaviors" feature.
My main issue is that I've got no formal JS training, so something is wonky with my script, but I'm not sure what...I'd appreciate any help with troubleshooting the below code!
I've attached the screenshots of what I'd like the formatted ticket template to look like, and the main error message I'm getting when writing the code in behaviors (pretty sure I just have no idea how to add multiple parameters one after the other correctly).
Thank you for any help here!
const descriptionValue = getFieldById("description").getValue();
const descriptionValueContent = descriptionValue.content.toString();
if (!descriptionValueContent) {
getFieldById("description").setValue({
"version": 1,
"type": "doc",
"content": [
{
"type": "panel",
"attrs": {
"panel type": "info"
},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Hypothesis:"
}
]
{
},
"type": "panel",
"attrs": {
"panel type": "info"
},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Goal:"
}
]
{
},
"type": "panel",
"attrs": {
"panel type": "info"
},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Estimated Business Impact:"
}
]
{
},
"type": "panel",
"attrs": {
"panel type": "info"
},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Needed By:"
}
]
{
},
"type": "panel",
"attrs": {
"panel type": "info"
},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Background/Details:"
}
]
}
]
}
]
});
}
Initial error I'm getting returned:

Goal for formatted ticket:
