Example scripts
To homepage
Jira

Dynamically show or hide a field
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira
Language |
typescript
const departmentField = getFieldById('customfield_10035');
const ticketCategoryField = getFieldById('customfield_10037');
const lineManagerField = getFieldById('customfield_10036');
const changedField = getChangeField();
switch (changedField.getName()) {
case 'Department':
switch (changedField.getValue().value) {
case 'Finance':
lineManagerField.setVisible(false);
ticketCategoryField.setVisible(true);
break;
case 'HR':
ticketCategoryField.setVisible(false);
lineManagerField.setVisible(true);
break;
case 'Product':
ticketCategoryField.setVisible(false);
lineManagerField.setVisible(false);
break;
}
break;
}
Having an issue with this script?
Report it here