Hi! I need to build a behavior script for editing the epic link field based on the reporter. I'm using a server-side script function, but the script doesn't work when the reporter is a different user.
Follow my script
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
def reporterfield = getFieldByName("reporter")
def cfEpicLink = customFieldManager.getCustomFieldObjectsByName("Epic Link")
if(reporterfield != ("rocket")){
getFieldByName("Epic Link").setReadOnly(false);
}
else
reporterfield == ("rocket")
getFieldByName("Epic Link").setReadOnly(true)