I want to hide project-specific "issue type" data. The code I shared works on "Jira v8". "Jira v7" does not work. Could you help?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager
import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE
def projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager)
def allIssueTypes = ComponentAccessor.constantsManager.allIssueTypeObjects
def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def issueTypeField = getFieldById(ISSUE_TYPE)
def remoteUsersRoles = projectRoleManager.getProjectRoles(user, issueContext.projectObject)*.name
def availableIssueTypes = []
availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["New Feature","Task","Test"] })
issueTypeField.setFieldOptions(availableIssueTypes)