Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can use any option type with any type of the custom field. For more information about our custom fields, see pages in the User Guide section.

Option typeDescriptionExample

Component Picker

This option is rendered as a project component.

This is the SIL script to get project components.  The example below shows how to get all components that exist in the "TEST" project. The components will be added as options to the custom field which uses this SIL script as data source.

Code Block
string projectKey = "TEST";
string[] componentNames = admGetProjectComponents(projectKey);
number[] componentId;
for(string componentName in componentNames){
    JComponent componentNames = admGetProjectComponent(projectKey, componentName); 
    componentId += componentNames.id;
}
return componentId;

This is the SQL script to get all components:

Code Block
select cname, id from component;

To see it in action, see the PCF - Checkbox page.

Group Picker

An option is rendered as a group.

This is the SIL script to get groups:

Code Block
return userGroups(currentUsername());

 It gets all groups to which current user belongs. The groups will be added as options to the custom field which uses this SIL script as data source. 


This is the SQL script to get all groups:

Code Block
select group_name from cwd_group;

To see it in action, check out the PCF - Multi Select page.

Issue Picker

An option is rendered as an issue.

This is the SIL script to get issues: 

Code Block
return selectIssues("created < now()");

 It gets all issues previously created. The issues will be added as options to the custom field which uses this SIL script as data source. 


This is the SQL script to get all issue keys:

Code Block
select  p.project_key ||'-'||i.issuenum as "KEY"
from jiraissue i
inner join project_key p on p.project_id = i.project

To see it in action, check out the PCF - Single Autocomplete page.

Project Picker

An option is rendered as a project.

This is the SIL script to get projects:

Code Block
string [] projects = allProjects();
return projects;

 It gets all projects previously created. The projects will be added as options to the custom field which uses this SIL script as data source. 


This is the SQL script to get all projects: 

Code Block
select pkey from project;

To see it in action, check out the PCF - Radio Buttons page.

User Picker

An option is rendered as a user.

This is the SIL script to get users:

Code Block
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;

 It gets all users existing in some groups (in this case, "jira-users") and adds the usernames that match the search as options to the custom fields using this data source.


This is the SQL script to get all users:

Code Block
select user_name from cwd_user;

To see it in action, check out the PCF - Multiple Autocomplete page.

Version Picker

An option is rendered as a version.

This is the SIL script to get versions:

Code Block
string projectKey = "TEST";
string[] versionNames = admGetProjectVersions(projectKey);
number[] versionId;
for(string versionName in versionNames){
    JVersion version = admGetProjectVersion(projectKey, versionName); 
    versionId += version.id;
}
return versionId;

 It gets all versions existing in the "TEST" project. The versions will be added as options to the custom field which uses this SIL script as data source. 


This is the SQL script to get all versions.

Code Block
select vname, id from projectversion;

To see it in action, check out the PCF - Single Select page.

...