Community moderators have prevented the ability to post new answers.
Hello.
I think you can set a condition, on the create transition, that will only allow certain users or groups to create issues with that type. There is also a "Hide transitionfrom user" condition that means that the creation of issues of that type can only be triggered from a listener or a workflow post-function.
You might need to install ScriptRunner to have these options, I'm not sure. You should be able to do something similar with the Behaviour plugin but I find ScriptRunner to be a lot easier to use.
Create transition doesn't have Conditions, only Validators and Post-functions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Teju,
By design it is not possible to achieve this using the behaviours module of Script Runner as Behaviours is keyed off the issue type.
The only way you can do this is to add a Behaviour to the issue type field which makes the field hidden for that project for that project and then have a second select list field where the user can check the correct issue type to use and have this set the issue type in order to prevent invalid issue types being used.
I understand this workaround is not ideal but this is the only way to achieve this requirement using ScriptRunner.
The code and config screenshot below show how I implemented this workaround on my JIRA 6.4.12 instance.
Code:
import com.atlassian.jira.component.ComponentAccessor // Get Issue Type Field as a constant value import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE // Get Issue-Type select list field and its value def issueType = getFieldByName("Issue-Type") def issueTypeVal = issueType.getValue() // If Bug selected set Bug Issue Type if(issueTypeVal =="Bug"){ getFieldById(ISSUE_TYPE).setFormValue("Bug") } // If Story selected set Story Issue Type if(issueTypeVal =="Story"){ getFieldById(ISSUE_TYPE).setFormValue("Story") } // If Task selected set Task Issue Type if(issueTypeVal =="Task"){ getFieldById(ISSUE_TYPE).setFormValue("Task") }
Config:
image2016-6-9 16:31:40.png
I hope this helps
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kristian,
I tired this code but didn't work for me.
Here is the snapshot :
image2016-6-10 17:44:47.png
And I have added mapping also. Did I missed anything ?
Thanks
Teju
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is above script worked? It's not working for me too. Anything missed?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kristian,
where is the user role/group based restriction in your solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Helllo,
At marketplace you can find plugin called Issue Type Filters. The plugin isn't very expensive and allow you to quickly hide issue types at creation dialog without complicated configuration.
.
Best regards!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.