PCF - Multiple Autocomplete
Contents
Multiple Autocomplete custom field enables you to select multiple options in an autocomplete select list field based on dynamic data source.
This custom field can be used for the following types of options:
- String (default)
- Component Picker
- Group Picker
- Issue Picker
- Project Picker
- User Picker
- Version Picker
Using PCF - Multiple Autocomplete custom field
If you go to an issue and edit this field, you will see an image like the following example:
Save the changes and the values will appear on the issue screen:
If the option type you selected is "Default", the picture above will look like the following example:
Examples
Using Multiple Autocomplete custom field with SIL Data Source
Getting Users
This example gets all users existing in certain groups (in this case, "jira-users") and adds the usernames that match the search as options to the custom fields using this data source.
function getUsers(string [] groups){ string [] users; for(string group in groups){ string [] currentGrp; currentGrp = addElement(currentGrp, group); for(string user in usersInGroups(currentGrp)){ users = addElementIfNotExist(users, usernameToUserKey(user)); } } return users; } string [] groups = {"jira-users"}; string [] users = getUsers(groups); string [] res; for (string user in users) { if (contains(user, argv["query"])) { res = addElementIfNotExist(res, user); } } return res;
Using Multiple Autocomplete custom field with SQL Data Source
To use SQL Data Source, set the JNDI first. You can see details on the Data Source Configuration page.
SQL Autocomplete Script
This example returns user names of all users.
select user_name from cwd_user;