I want to hide the issue type in a project and i tried script runner behaviour . Here the script below
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 = [] if ("Users" in remoteUsersRoles) { availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["Query", "General Request"] }) } if ("Developers" in remoteUsersRoles) { availableIssueTypes.addAll(allIssueTypes.findAll { it.name in ["Bug", "Task", "New Feature"] }) } issueTypeField.setFieldOptions(availableIssueTypes)
But i'm getting error code is
Parsing XML failed: Unexpected character 'i' (code 105) in prolog; expected '<' at [row,col {unknown-source}]: [1,1]
Also attaching the screen shot below
and we are using script runner version is 5.7.0 and jira version is 7.13.11
Please help me with this where to changes implemented on script
Thanks,
Siva
Is there something preventing you from removing the 'support' issue type from the Issue Type Schemes that the current project is using?
Thanks for the responce,
Is there any related script so i can hide the 'SUPPORT' issue type in particular project.
Note: Support issue type is assign with few issues in this project so i am unable to delete in Issue Type Schemes. So, i want to hide using behaviour please let me know is any relevant script.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In case it is just because some issues are currently having this issue type you could migrate them to any other issue type defined in your Issue Type Scheme - would that be an option?
Restricting issue types is possible, however I have never tested it with a Service Management project:
https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/restricting-issue-types.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.