Example scripts
To homepage
New
Jira

Prefill fields with user info and dates for JSM
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira
Language |
typescript
// Replace with your actual custom field IDs
const employeeNameField = getFieldById("customfield_11546");
const startDateField = getFieldById("customfield_10015");
const summaryField = getFieldById("summary");
const descriptionField = getFieldById("description");
const employeeName = employeeNameField.getValue();
const startDate = startDateField.getValue();
// Only update when both fields have values
if (employeeName && startDate) {
summaryField.setValue(`${employeeName} will be joining the company on ${startDate}`);
descriptionField.setValue({
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [{ "type": "text", "text": `Employee: ${employeeName}` }]
},
{
"type": "paragraph",
"content": [{ "type": "text", "text": `Start date: ${startDate}` }]
}
]
});
}Having an issue with this script?
Report it here