Versions Compared

Key

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

...

Go to the Administration page, choose Custom Fields link and add a SIL script custom field.

Image Modified

After you create the field, go to the corresponding Configure link. A page like in the image below will appear:

Image Modified

Click on the Edit SIL Script link to see the SIL editor.Image Removed

Image Added

Click on the Save button and the script is associated to the current custom field.

Image Added

The value returned by the script will be the value of the custom field.

Image Removed

Now type in the SIL script a return value, for example: return priority; 

Warning

The script is read-only. You must avoid changing any issue values in the script.

 

Thread Local Caching

Note

If you are not fully aware of what this implies, it is recommended that you leave the option off.

...

Go to an issue and this is how the value of the field is the value returned by the script.Image Removed

Image Added

That's it.

 

Other Examples

Issue Age

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

Image Added

 

Number of subtasks

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

Image Added

 

Average Issue Age

Code Block
date now = currentDate(); // just to make sure we use the same reference date
string [] subtasks = subtasks(key);
interval age;
for(string task in subtasks){
 age = age + (now - %task%.created);
}
return "Average age of subtasks is " + (age / size(subtasks));

Image Added