---
title: "Option types"
canonical: "https://support.appfire.com/space/PSJ/1589019660/Option%20types"
format: markdown
---
> Macro (aura-html)

> Macro (button-handy)




---

## Supported option types by custom field type

Power custom field types can be used with different data option types. 

| **Field type** | **Supported data options** | **Can be modified to…** |
| --- | --- | --- |
| **Multiple-option types:**<br>- PCF - Checkbox
- PCF - Multi Select
- PCF - Multiple Autocomplete
- PCF - Radio Buttons
- PCF - Single Autocomplete
- PCF - Single Select | You can select any of these option types available as templates during field configuration:<br>- Component Picker
- Group Picker
- Issue Picker
- Project Picker
- User Picker
- Version Picker | - String (default)
- If changed to string, can be modified back to any of the six supported data options for this field. |
| **String type only:**<br>- PCF - Interval Field
- PCF - Regular Expression Custom Field
- PCF - SIL Script Custom Field | - String (default) | N/A |
| - PCF - SIL User Picker | The options for this field are determined by the SIL script you used to configure it; they appear as users in the right-side of the View Issue page. | N/A |

---

## Data retrieval Reference for pre-configured option types (SIL and SQL)

The reference table below explains how to retrieve data for custom fields using either SIL or SQL scripts with any of the pre-configured templates.  


![pcf-templates-single.png](media://82dd6e40-3d2c-4210-a37c-3133e1d27326)

| **Option type** | **Description** | **Examples** |
| --- | --- | --- |
| ### Component Picker | Provides a selection of components from your Jira instance. | - Use this SIL script to retrieve all components from a specified project and add them as options to the custom field. This example script retrieves all components from the "TEST" project and returns their IDs. The components will be added as options to the custom field which uses this SIL script as data source. The script first gets component names using `admGetProjectComponents`, then iterates through each component to collect its ID using `admGetProjectComponent`.<br>```
string projectKey = "TEST";
string[] componentNames = admGetProjectComponents(projectKey);
number[] componentId;
for(string componentName in componentNames){
    JComponent componentNames = admGetProjectComponent(projectKey, componentName); 
    componentId += componentNames.id;
}
return componentId;
```<br>> ℹ️ After creating the Power custom field, you must set your project key in the SIL script data source (replace "TEST" with your project key). This ensures the picker will display issues specific to your project rather than the example project.<br>- Alternatively, you use this SQL query to retrieve all components and their IDs from the component table.<br>```
select cname, id from component;
```<br>- To see how the **Component Picker **is used, see the [PCF - Checkbox](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/1589019950) page. |
| ### Group Picker | Provides a selection of groups from your Jira instance. | - Use this SIL script to retrieve all groups that the current user belongs to. These groups will be added as options to the custom field which uses this script as data source<br>```
return userGroups(currentUsername());
```<br>It returns all groups that the current user belongs to. The groups will be added as options to the custom field which uses this SIL script as data source.<br>- Alternatively, use this SQL script to retrieve all available groups from the system<br>```
select group_name from cwd_group;
```<br>- To see how the **Group Picker** is used, see the [PCF - Multi Select](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/1589019824) page. |
| ### Issue Picker | Provides a selection of issues from your Jira project. | - Use this SIL script to retrieve all previously created issues. These issues will be added as options to the custom field which uses this script as data source.<br>```
return selectIssues("created < now()");
```<br>- Alternatively, use this SQL script to retrieve all issue keys from the system.<br>```
select  p.project_key ||'-'||i.issuenum as "KEY"
from jiraissue i
inner join project_key p on p.project_id = i.project
```<br>- To see how the **Issue Picker** is used, see the [PCF - Single Autocomplete](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/1589019773) page. |
| ### Project Picker | Provides a selection of projects from your Jira instance. | - Use this SIL script to retrieve all previously created projects. These projects will be added as options to the custom field which uses this script as data source<br>```
string [] projects = allProjects();
return projects;
```<br>- Alternatively, use this SQL script to retrieve all projects from the system.<br>```
select pkey from project;
```<br>- To see how the **Project Picker** is used, see the [PCF - Radio Buttons](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/1589019995) page. |
| ### User Picker | Provides a selection of users from your Jira instance. | - Use this SIL script to retrieve users based on group membership and search criteria. The script works by first getting all users from the specified groups (in this example, "jira-users"), then filters them based on a search query. The matching usernames will be added as options to the custom field which uses this script as data source.<br>```
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, 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, usernameToUserKey(user));
    }
}
return res;
```<br>> ℹ️ Before using this script, you must replace "jira-users" with your group name in the SIL script data source. This ensures the picker will display groups specific to your Jira instance.<br>- Alternatively, use this **SQL** script to retrieve all users from the system.<br>```
select user_name from cwd_user;
```<br>- To see how the **User Picker** is used, see the [PCF - Multiple Autocomplete](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/1589019900) page. |
| ### Version Picker | Provides a selection of versions from your Jira project. | - Use this SIL script to retrieve all versions from the "TEST" project. In this example, the script gets all version names using `admGetProjectVersions`, then iterates through each version to collect its ID using `admGetProjectVersion`. These versions will be added as options to the custom field which uses this script as data source.<br>```
string projectKey = "TEST";
string[] versionNames = admGetProjectVersions(projectKey);
number[] versionId;
for(string versionName in versionNames){
    JVersion version = admGetProjectVersion(projectKey, versionName); 
    versionId += version.id;
}
return versionId;
```<br>> ℹ️ After creating the Power custom field, you must set your project key in the SIL script data source (replace "TEST" with your project key). This ensures the picker will display versions specific to your project rather than the example project.<br>- Alternatively, use this SQL script to retrieve all versions from the system.<br>```
select vname, id from projectversion;
```<br>- To see how the **Version Picker** is used, see the [PCF - Single Select](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/1589019720) page. |