The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Issue type

siva
Contributor
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Dillon
Contributor
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
Contributor
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 Champions.
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