Scope
This article explains various levels of scope when running a SIL script.
Jira Level Scope
Whenever you run a SIL script, the runtime environment provides both a Jira scope and an issue context. With a Jira scope, this allows you access to SIL-defined routines, structs and variables. The Jira scope also provides issue context. This allows you to access Jira issues inside the runtime environment.Â
Block Scope
The SIL language is block scoped. A variable declared within the contents of curly braces only has access to that variable inside those braces. For example, consider the following code:
{
Â
string value =Â "hello";
Â
}
Â
runnerLog(value); |
This results in the following error message:
Field >>value<< cannot be matched against a standard field, a custom field or an alias. What is it? |
The reason for this is that the "value" variable was defined inside the code block and is not available outside it when the runnerLog() line attempts to print the contents of the "value" variable. If you wish to have access to the "value" variable, define it outside the context of the defined block. For example:
string value;
{
value =Â "hello";
}
Â
runnerLog(value); |
This of course prints out "hello".
The block scope extends to user-defined routines and loops.Â
Additional Help
Need help implementing this script? Talk to me directly to me by clicking on the bot on this page.
Related articles
Filter by label
There are no items with the selected labels at this time.