Example scripts
To homepage
Jira

Set a default description when an issue is created
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira
Language |
typescript
const descriptionValue = getFieldById("description").getValue();
// Check if the description field is a wiki markup type field
if (typeof descriptionValue !== "string") {
const descriptionValueContent = descriptionValue.content.toString();
// Only set the field if it does not already have a value
if (!descriptionValueContent) {
getFieldById("description").setValue({
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "As a ",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": "<type of user>"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "I want ",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": "<to achieve some goal>"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "So that ",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": "<some reason is fulfilled>"
}
]
}
]
})
}
}
Having an issue with this script?
Report it here