Hi
I created following script but it does not seem to work. No errors in Log though:
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
def componentManager = ComponentManager.getInstance()
FormField issuetype = getFieldById("issuetype");
def it=issuetype.getValue();
def constantsManager = ComponentAccessor.getConstantsManager()
Map allowedIssueTypes =constantsManager.getAllIssueTypeObjects().findAll {
it.name in ["Bug","Epic"]
}.collectEntries {
[(it.id): it.name]
}
//println(allowedIssueTypes.toString())
// issuetype.setHelpText(allowedIssueTypes.toString());
issuetype.setFieldOptions(allowedIssueTypes)The content of allowedIssueTypes is: [1:Bug, 10000:Epic]
I am running JIRA v6.4.6.
I don't care about the condition.
What I want to do is I want to limit the number of issue Types to Bug and Epic for all users in certain group (the condition is not relevant) I am using behavior attached to Issue Type field
What am I doing wrong? Thanks!
1. Script runner 3.1.4
2. JIRA v6.4.6
3. Within Behaviour pugin mapped to all issue types in the project and Associated to Issue Type.
4. There is no error going to the log. But when I add the line: issuetype.setFieldOptions(allowedIssueTypes)
I am not seeing any effect. Even the println(allowedIssueTypes.toString()) is not working 