Versions Compared

Key

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

...

4. After you create the field, go to the corresponding Configure link. You will see a page like the following example:

5. Click on the Edit SIL Script link to see the SIL editor.

...

Because multiple calls to get the value of a SIL Script Custom Field for a certain issue are inevitable, we implemented an option to generate the value only once per HTTP request. This can improve performance, but might have some side effects.
For exampleinstance, if the value is generated before some other values it depends on are modified, the result might not reflect latest updates.

Using PCF - SIL Script custom field

...

Code Block
interval age = currentDate() - created;
return "This issue is " + age + " old";

 

Number of subtasks

Code Block
number noSubtasks = size(subtasks(key)); 
return "This issue has " + noSubtasks + " subtasks";

...

Code Block
string[] assignees;
assignees = addElementIfNotExist(assignees, userFullName(assignee)); 
string[] assigneeHistory = fieldHistory(key, "assignee"); 
for(number i = 1; i < size(assigneeHistory); i = i + 2) {
 string assigneeName = userFullName(getElement(assigneeHistory, i));
 assignees = addElementIfNotExist(assignees, assigneeName); 
}
return assignees;


Search Issues

  1. If you want a Sil Script Custom Field to be searchable you must select a Search Template for that custom field.

2. If the custom field already exists, in Administration->Custom fields, click Edit for the desired custom field, and choose the proper Search Template for your custom field according the value type returned by it.

3. If you are about to add a new Sil

...

Script Custom Feld, you can choose the Search Template at the step 'Create Custom Field - Details (Step 2 of 2)'.

...

Note

Perform a re-index
After changing the Search Templates for all the custom field that you want, perform a re-index in JIRA Jira for the search to work fine.

 

4. After a searcher has been set for the Sil Script

...

Custom Field, you can perform a search for all issues containing the desired value for that custom field.

5. For a detailed explanation on searching issues in

...

Jira, you can check the Searching for Issues tutorial from the

...

Jira documentation.