Skip to end of banner
Go to start of banner

Automation (Script) Templates

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

About

Script Templates are an easy way to add automated actions instantly and without any coding. We have taken some of the most common types of scripts and converted them into an easy to use interface.

However, this does not mean scripting is not used. When creating the action using a template the script gets generated for you. We do this because we firmly believe that script is the most flexible, most powerful way to incorporate automation into your Jira system. We release that not everyone is comfortable scripting so we created the templates to guide users through the process.

In the image above, you can see the script getting written in the SIL code preview panel as the user enters information into the input fields. We do this with the hope that after seeing real word applications of the scripts you will become more familiar with the way they are written and gain confidence in modifying and writing the scripts in the future.

The scripts, after being generated, are also automatically applied so that little to no experience to the administration of Jira is required. However, these templates are designed to be simple guides and continued reliance on them for Jira configuration could result in a less than optimal configuration. It is still advised that someone with more experience reviews the configuration changes after they are applied.

Who are the templates for?

The Script Templates are for Jira administrators wishing to gain the ultimate power of script based automation but are confused or intimidated by the process. They are for admins or Product Owners who wish to gain the benefits of automation immediately without prior scripting knowledge or experience. They are for users who want to learn by doing instead of reading or watching videos.

Script templates are not for the thousands of existing SIL scripting ninjas already using Power Scripts or related apps. We have built some exiting new tools for them so they will be fine.

Where can they be found?

The Script Templates can be found in multiple places.

Jira Administration

Primarily they can be found on the “Find New Apps” or “Manage Apps” administrative pages in Jira.

When using script templates from the Jira admin pages, all script types will be available for use

Workflows

Additionally, script templates can also be found in other areas like while editing the workflows. You must first add a SIL Condition, SIL Validator, or SIL Post Function to the workflow as seen below.

As seen below, when configuring the SIL Post Function the user can choose between adding a new template, writing a new script, or reusing an existing script.

However, it is important to note that the templates will be filtered based on the type of workflow action being configured. So, for example, when setting up a SIL Post Function, only post function script templates will be available for use.

What happens when the template is applied?

When a template gets applied, the script that was seen in the preview window actually gets created in the system. The SIL Manager is the code editor for SIL scripts and holds the repository for all the scripts used by Power Scripts. Inside this repository you will find a folder called generated_templates. Inside this folder will be subfolders that correspond to different script types and under those you will find that actual script that was generated.

Next, a configuration must be added so that Jira knows which script corresponds to specific events or actions. For example, for a listener script to run it must be associated with an internal event within Jira. In the example below we can see which scripts correspond to events like “Issue Closed” and “User Created”.

Many configurations are found within the Power Scripts administration section of the Jira admin. However, this is not true for all of them. Some configurations, like post-functions, are added to the issues workflow. If not familiar with editing workflows this may not seem very straight forward so the configurations will get added to those workflows automatically.

Our hope is for you to then investigate the script and the configuration so you can see how these two things relate to each other and how they get configured. Our main goal is to guide you through setting up these configurations so that you can set them up without the assistance of the templates in the future.

How to make changes existing template scripts?

As mentioned above, there are script files that get created when a template is applied. This means that changes to the applied template can be made directly in those scripts so that it can be customized to your specific needs. Changing the code within a script file does not affect the configuration. This changes can be made independently without updating the workflow or any other type of configuration.

WARNING: Changing the name of a script or moving its location to a different folder will impact existing configurations since the configuration will no longer be able to locate that file. If you wish to change the name or move the file location the configuration needs to updated.

What type of templates are available?

Validator Templates

Validators will prevent the user from transitioning an issue in Jira from one status to another unless the conditions for the validation are met. Validators can be used to ensure data is entered into a custom field before the user can continue, validating the format of that data, or checking some other aspect about the user or issue before allowing the transition to complete.

The templates will create this validation process by adding a new validation script to an existing workflow transition within Jira.

See more…

Condition Templates

Conditions will prevent the user from transitioning an issue in Jira from one status to another unless the requirements for the condition are met. Conditions can be used to prevent users from starting a transition based on the requirements in the script. If a user has not met the condition the user may not ever know the transition was an available option.

The templates will create this condition process by adding a new condition script to an existing workflow transition within Jira.

See more…

Post-Function Templates

Post-functions are actions that occur after an issue is transitioned. Post-functions represent one of the largest categories of use cases for automation.

The templates will create the post-function by adding a new post-function script to an existing workflow transition within Jira.

See more…

Listener Templates

Listener scripts are extremely useful because they capture a wide range of events that occur both inside and outside of the issues workflow. Listeners can capture such things as issue edits, or the creations of new objects within Jira.

The templates will add scripts to associated events within Jira.

See more…

Recurrent (Scheduled) Job Templates

Recurrent jobs are actions that occur at specified time intervals or on specific dates. These jobs are scheduled because either there is not other trigger type that can be sufficiently used, or because of other time or performance considerations. Some jobs, like jobs to trigger reindexing, may impact the performance of Jira so these can be scheduled off hours so users are not impacted. Other jobs, may rely on external factors like operations completing on external systems before the data can be synchronized. Or, another use for scheduled jobs is to create an escalation service that raises the priority on issues that are past due.

The templates will create the recurrent job by adding a new recurrent job script and its schedule to the configuration.

See more…

Live Fields Templates

Live Fields are actions that occur when an user views one of the issues screens. These scripts allow for the control of these fields in a variety of helpful ways. They add the ability to extend the permissions control within Jira as well as helping the user by pre-populating fields or automatically controlling the field options in some other way.

The templates will create the Life Fields script by adding a new configuration for Live Fields. To learn more about using Live Fields see this page.

See more…

Custom Field Templates

Custom fields template scripts are scripts that directly affect the value, appearance, configuration, or behavior of a custom field. With Power Scripts, there isn’t a concept of a custom field specific script/trigger, instead the scripts in this category are actually types like, post-functions, listeners, and Live Fields scripts. These different script types accomplish the goal of updating and controlling the custom field types that are natively found in Jira. However, if you have advanced and complex problems that can’t be solved using standard Jira fields, Power Custom Fields introduces new custom field types that are directly controlled by SIL scripts.

The templates will create the custom field script by adding the script to the configuration that corresponds to the individual script.

See more…

Notification Templates

Notification template scripts are scripts that directly relate to communication and messaging through writing to files or sending notifications, like emails, directly.

The templates will create the notification script by adding the script to the configuration that corresponds to the individual script.

See more…

User Templates

User template scripts are scripts that directly related to specific users in Jira. These are scripts that may set field values with specific users or control behaviors based on the specific user session using Jira.

The templates will create the user script by adding the script to the configuration that corresponds to the individual script.

See more…

Will new templates be added?

Yes, from time to time new templates will be created and added to the list. The templates chosen for created will be determined by demand and specific templates can be requested for consideration through our support portal.

However, the goal of these templates is to provide you with an example of how to create a similar solution, not to necessarily take all of the work out of creating a new script and solve everyone's problems. Again, we firmly believe that scripting makes the most flexible and powerful solutions and which to guide you into becoming a SIL scripting ninja!

Contents

  • No labels