Skip to end of banner
Go to start of banner

Scope

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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.

Filter by label

There are no items with the selected labels at this time.

  • No labels