User guide
Before using SIL™ User Picker custom field check out the Simple Issue Language™ documentation for a better grasp of SIL™ usage and capabilities.
How to configure
Adding a new SILâ„¢ User Picker custom field is as easy as adding any other custom field.
To do that:
- Log into your Jira as Admin.
- Go to Administration > Custom Fields > Add Custom Field, and select SIL™ User Picker custom field from the list.
- Follow the on-screen instructions.
- Go to the Configure link, and click the Edit SIL™ Script link to define a SIL™ script.
- Write a SIL™ script.
Click Save, and the script will get associated with the current custom field. The values returned by the script are the values available for the custom field.
In our example, the SIL User Picker custom field is configured to filter only users that are members of the jira-developers or Jira-administrators group.
To set the number of characters that user autocomplete feature is triggered for the field use the global autocomplete threshold parameter from the User Group Picker PRO configuration page. The default value for the autocomplete threshold is set to 2.
For example, if you select "3" for the autocomplete threshold on the configuration page as shown in the example above, the list of suggested users matching the criteria in the user group picker will be shown after the third character in the input is entered.
How to use it
- Go to an issue and check the users available for selection by clicking the user picker icon or by typing something in the input.
Only users retrieved from the SILâ„¢ script will be available for selection (in this case administrators and developers). - Select the necessary user and save it on the current issue. The field value appears on the right side of the view issue screen, in the People section:
3. Edit the field on a view issue screen by clicking on the inline edit icon next to the field to see suggested users filtered accordingly to the SILâ„¢ script.
That's it.
Other examples
Here are more SILâ„¢ scripts examples that you can use to configure your SILâ„¢ user picker fields. Basically, by means of SILâ„¢ you can restrict the users selection to any criteria you want.
Issue Assignees
string[] assignees; assignees = addElementIfNotExist(assignees, assignee); string[] assigneeHistory = fieldHistory(key, "assignee"); for(number i = 1; i < size(assigneeHistory); i = i + 2) { string assigneeName = getElement(assigneeHistory, i); assignees = addElementIfNotExist(assignees, assigneeName); } return assignees;
Users in specific role
return usersInRole(project, "Developers");
Users in specific group
return usersInGroups("jira-developers");
Searching issues
When you create a new SIL User Picker custom field, the default searcher set is SILâ„¢ User Picker and Group Searcher. This filters the available users for the custom field in issue navigator accordingly to the configured SILâ„¢ script.
However, when using SILâ„¢ issue specific variables in the script (for instance project, key, assignee, reporter), you have to use Jira's standard searcher User Picker and Group Searcher for that field, or otherwise you will not be able to select any value for filtering.
When using the SILâ„¢ User Picker & Group Searcher, user suggestions in issue navigator will be retrieved based on the SILâ„¢ script from the field's global configuration.
- Go to Administration > Custom fields
- Click Edit for the desired custom field
- Choose the proper Search Template for your custom field.
- Perform a re-index — After the Search Templates are changed for all the custom field that you want, perform a re-index in Jira for the search to work fine.
- After a searcher has been set for the SILâ„¢ User Picker custom field, you can perform a search for all issues containing the desired value for that custom field
For a more details about searching tickets in Jira, you can check the Searching for Issues tutorial from the Jira documentation.