Hello.
I'm using Behaviors in Jira to select certain options (Jira project names) that are preloaded in a Project Picker field. By default, the Project Picker field lists all the projects in my Jira environment, but I'm trying to 'pick and choose' the projects I want loaded, based on certain criteria, when I create a task/issue.
The following code snippet limits some of the options that are loaded in the field when a new task/issue is created:
def proj_options = projects.findAll{
if(it.name}{
it.name in ["AB(C) Test", "Proj1", "Proj2", "Test Config"]
)]
formfield.setFieldOptions(proj_options)
The code works for projects Proj1 and Proj2; however, projects AB(C) Test and Test Config are not loaded in the field. I believe this because one project name has "(" and ")" in it and the other has a reserved word ("Config") in it.
I've tried using the character escape option, but that didn't work (I may not have use it correctly).
Will someone please let me know how to fix this line - it.name in ["AB(C) Test", "Proj1", "Proj2", "Test Config"] - so those two other projects will appear in the field list?
Thanks,
Mark
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.