Hide Issue type

siva July 20, 2021

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 

Hide support type.png

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

1 answer

0 votes
Dillon July 20, 2021

Is there something preventing you from removing the 'support' issue type from the Issue Type Schemes that the current project is using?

siva July 20, 2021

@Dillon 

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

Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2021

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

Suggest an answer

Log in or Sign up to answer