Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,267
Community Members
 
Community Events
168
Community Groups

Use SIL to the maximum Part 3

Part 2

Switch User

This menu let us work in Jira under any registered user in Jira without knowing the password of the user. You can find Vendor's information here.

Screenshot 2020-05-24 at 10.40.41.png

The list of users is limited but you can type letters in the User field and users will be filtered for you:

Screenshot 2020-05-24 at 10.41.46.png

Click on the user you want to work under, push the Switch! button and you will be logged in as this user without providing the password of this user.

To return back to your user you can use the Switch Back To option:

Screenshot 2020-05-24 at 10.50.44.png

SIL Configuration

This menu option lets you set configuration parameters for SIL. You can find Vendor's information here.

Screenshot 2020-05-24 at 11.13.14.png

SIL Home Directory lets you change the file folder where all sil scripts will be placed. By default all scripts are placed to your JIRA_HOME/silprograms folder, but you can place the scripts into any folder you want under the JIRA_HOME folder.

Charset lets you define the character encoding for your scripts. I think it is better to leave it as it is UTF-8. Maybe you would need to change it if you save your sil scripts in the Jira database and somehow your database character set is not UTF-8. But I would say it is a very rare case. You should use UTF-8 in all your Jira settings.

SIL Cache size lets you define the number of the parsed SIL scripts in the SIL cache.

Why would we need a SIL cache at all?

Here is a simple script in sil:

string message = "My message";
runnerLog(message);

In order to execute this script SIL must convert this script to Java byte code. There are many different constructions in SIL like structures, functions, inclusions, loops, conditions, assignments, variable type conversions and so on. All of it must be converted from SIL code to Java byte code. And it all takes time. That is why once SIL code is parsed the Java byte code is saved in the SIL Cache to save your time on parsing this SIL code again.

That is why if you have thousands of scripts it makes sense to try to increase this parameter and have a look if you have performance gain.

Datasources

This menu option lets you add database source which can be used later in your scripts. It is very handy because you do not need to hardcode database connection and user password in the code. You can find Vendor's information here.

Screenshot 2020-05-24 at 13.04.14.png

Let's configure a database source and use it later in sil scripts.

Push the Add Datasource button and connect to an external database:

Screenshot 2020-05-24 at 13.17.46.png

I put up a second Jira instance in my notebook and connected to the database of the second Jira instance.

It is important to mention that SIL does not contain jdbc drivers in its distribution that is why you need to make sure yourself that you have an appropriate driver in your Jira instance. You can read here about adding jdbc drivers to Jira.

Now let's push the Save button and we will have a new data source called external_database configured:

Screenshot 2020-05-24 at 13.21.55.png

Now let's use it in our SIL script:

string [] results = sql("external_database", "select * from cwd_group");
runnerLog(results);

I executed an sql query on my external database and received a result:

Screenshot 2020-05-24 at 13.28.37.pngPart 4

0 comments

Comment

Log in or Sign up to comment
TAGS

Atlassian Community Events