Skip to end of banner
Go to start of banner

SIL Runner Gadget

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 10 Next »

Important!

You can customize the gadget to be more user friendly, asking parameters more nicely. See more details here.

Another useful feature of JJupin is the ability to randomly run SIL scripts on demand using the SIL Runner Gadget. This allows you to configure a list of scripts that can be run at any time directly from your Dashboard.

Important!

Bare in mind that scripts ran this way do not have an issue context! Therefore, constructs and keywords like 'key' do not have a meaning here (they are undefined!). You need to first select the issues to work with, and prefix any standard variables with the issue key!

Configuration

The configuration screen is only available to JIRA Administrators and System Administrators and allows them to manage the list of available SIL scripts. They can add, configure security and delete scripts or edit the parameters of a runnable SIL script.

To add a script to the runner you must give it a name, description and select an already existing file containing the script.

The gadget also offers the ability to restrict script usage to specific users or groups by choosing a security option:

    

          Public - the script will be available for any user

          Group - the script will be available only if the currently logged in user is a member of the specified group (will display a group picker)

          User - the script will be available only if the currently logged in user is the same as the specified one (will display a user picker)

  Project role - the script will available only if the currently logged in user is in a specific role on a specific project (will display a project picker)



Info

To edit the actual scripts, please use the SIL Manager.

Usage

Example


When you select a script from the list, its description will automatically be filled in below.

The Parameters field is used to pass values into your SIL program. To add a parameter click the Add Parameter button.

Parameter names must be unique, otherwise the most recent definition will overwrite previous ones. This includes parameters with no name.

The parameters will be passed into the program using the argv variable. The values will be available using a construct like argv["parameter_name"] or argv[position]. For the above example, the number of rockets can be retrieved using argv["rockets"] or argv[2].

Tip

 Parameters can be reordered using drag and drop.

Once you run the script, the program console will be displayed.

You can use the runnerLog routine to print info in the console as the program runs. Note that the console buffer is limited to 512 lines every ~0.5 sec and the console will only display the latest 512 lines.

Example code
runnerLog("Preparing to start a war...");

runnerLog("Building tanks...");
runnerLog("Built " + argv["tanks"] + " tanks.");

runnerLog("Gathering infantry...");
runnerLog("Gathered " + argv["infantry"] + " brave men.");

runnerLog("Fueling rockets...");
runnerLog(argv["rockets"] + " ready.");

runnerLog("Dispatching orders...");
return "Good job! The world is now at war!";

Tip

You can return as many values as you need, regardless of their type.

  • No labels