Forums

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

how can I create a button with only few issue types

Виктория
Contributor
November 27, 2020

how can I hide some issue type in the button what created by scriptrunner.
I need to keep only sub-bug and test types.

Script fragments 


Link

/secure/CreateSubTaskIssue!default.jspa?parentIssueId=${issue.id}&issuetype=10003 - only one type

/secure/CreateSubTaskIssue!default.jspa?parentIssueId=${issue.id} - all issue types

1 answer

0 votes
Moses Thomas
Community Champion
November 27, 2020

@Виктория   For sure you can do it with the Behaviors from the script runner plugin

please see similar question here  with sample code, if you have problem you can paste your code here

https://community.atlassian.com/t5/Jira-questions/Hide-Issue-Types-from-Jira-Create-Issue-Screen/qaq-p/977924

 

Kind regards,

Moses.

Виктория
Contributor
November 30, 2020

@Moses Thomas Its not working with the "button", what was created by fragments by the same Scriptrunner.

Screen Shot 2020-11-26 at 13.44.28.png

Виктория
Contributor
November 30, 2020

@Moses Thomas 
by this condition I can hide this button from the customer role. but it works in all projects, I need hide it in only two of them. Help me please with the script

Screen Shot 2020-11-30 at 14.51.01.png

Moses Thomas
Community Champion
December 8, 2020

@Виктория   In your code you are not checking  the projects, before restricting it  to the customer role. Try this.



if (issueContext.projectObject.name == 'A' || issueContext.projectObject.name == 'B')
{

!projectRoleManager.isUserInProjectRole(currentUser,CustProjectRole,issue.getProjectObject())

}

 Kind regards,

Moses

Suggest an answer

Log in or Sign up to answer