Hi guys,
I need help. We have a requirement to set priorities based on the issue type. We are using the JIRA Server 8.20.12 version now. I have written this below code for the Task issue type. It's working fine on the Create screen But not on the edit screen. Can u help me to find a solution for this?
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.PRIORITY
def constantsManager = ComponentAccessor.getConstantsManager()
def formField = getFieldById(PRIORITY)
def availablePriorities = ["High","Low"]
if(issueContext.issueType.name == "Task")
{
formField.setFieldOptions(availablePriorities)
}