Script types and triggers

Script types and triggers

 

 

Power Scripts for Jira DC uses SIL scripts that integrate with specific trigger points or 'hooks' in Jira. These hooks determine when scripts execute in Jira's processes, giving you more control over your Jira instance while reducing manual work.

To effectively implement these scripts, you must have a solid understanding of core Jira concepts, such as custom fields, screens, workflows, issue types, and projects.


Hook types and tasks

Scripts run automatically when their associated hooks are triggered, working seamlessly in the background. Each hook type enables different kinds of tasks. The following table shows the various hook types in Power Scripts for Jira DC, their trigger points within the system, descriptions, and example automation tasks that can be performed with each hook type.

Hook Type

Trigger Point

Description

Example Tasks

Hook Type

Trigger Point

Description

Example Tasks

Workflow hooks

During workflow transitions (before or after)

Scripts triggered during workflow state changes

  • Validate transitions

  • Update fields

Issue hooks

When viewing or editing issues

Scripts triggered by issue-related events

  • Modify screens

  • Calculate field values

Scheduled hooks

At specified times

Scripts that run according to defined schedules

  • Generate reports

  • Clean up data

External hooks

In response to external events

Scripts that connect with external systems

  • Integrate with other systems

Service Management hooks

Within automation rules

Scripts that extend native Service Management automation

  • Create custom conditions

  • Implement specialized actions

Email hooks

When processing incoming emails

Scripts that handle email processing

  • Route emails to specific projects

  • Parse email content into fields

System hooks

During Jira startup/shutdown

Scripts that monitor system status

  • Send notifications

  • Perform system checks


Script types reference

The following table outlines the main script types available in Power Scripts, describing what each component does, when it's triggered, and its primary purposes.

Script type

Description

Trigger point

Used to

Script type

Description

Trigger point

Used to

Workflow Conditions/Validators

Scripts that act as gatekeepers in the workflow process

BEFORE any workflow transition

  • Control transition visibility

  • Enforce user permissions

  • Implement security rules

  • Validate data

  • Prevent unauthorized actions

  • Prevent unauthorized actions

Workflow Actions (Post Functions)

Scripts that execute automated actions after a transition is completed

AFTER any workflow transition

  • Create sub-tasks

  • Copy parent data

  • Calculate field values

  • Push data to databases

  • Send custom notifications

  • Perform automated follow-up tasks

Listeners

Scripts that monitor and respond to various system events across multiple workflows

AFTER workflow transitions and other system events

  • Monitor multiple workflows simultaneously

  • React to non-workflow actions (issue edits)

  • Respond to system events: new user creation, project creation, version creation, and issue updates.

  • Provide cross-workflow automation

  • Enable system-wide monitoring

  • Execute global automated responses

Live Fields

Scripts that control the behavior of fields on issue screens

When viewing, editing, or creating issues

  • Hide or show fields dynamically

  • Disable fields based on conditions

  • Pre-populate field values

  • Create interdependencies between fields

  • Customize screen behavior

Scheduled Jobs

Scripts that run automatically at specified time intervals without user interaction

At defined time intervals (daily, weekly, monthly, or custom schedules)

  • Work with issues in bulk

  • Execute time-based tasks such as:

    • Escalate priority of overdue issues

    • Auto-assign issues created that day

JQL Keywords

Pre-built and custom functions that extend Jira's search capabilities

During JQL query execution

  • Enhance Jira's native search functionality

  • Implement custom search keywords

  • Enable advanced issue-finding

Service Management Automation

Scripts that extend native Service Management automation capabilities

Within Service Management automation rules

  • Create custom conditions for the WHEN and IF sections

  • Implement specialized actions in THEN sections

  • Extend automation rule capabilities

Email Handlers

Scripts that customize email processing in Jira

When processing incoming emails

  • Route emails to specific projects based on sender

  • Determine issue type based on subject keywords

  • Parse email body content into custom fields

  • Customize email-to-issue conversions

REST Service

Integration scripts that enable two-way communication with external systems

When external systems make or receive calls

  • Enable real-time two-way integrations

  • Process incoming external system calls

  • Send outgoing REST calls

Webhooks

Custom URL endpoints for external system communication

When external systems send messages

  • Receive messages from external systems

  • Enable system-to-system integrations |

SIL Runner Gadget

Dashboard-based tool for custom button actions

On user interaction (button click)

  • Create custom UI buttons

  • Implement simple forms

  • Enable non-admin access to scripts

Jira Start/Stop

System event monitoring scripts

During Jira startup or shutdown

  • Send notifications when Jira goes down

  • Perform actions during system startup/shutdown

  • Monitor system status

SIL Panel

Scripts that run in a custom section within Jira issues

Within issue view

  • Display custom content

  • Show custom charts/graphs

  • Present issue-specific information

  • Workflow Conditions/Validators: These scripts live in the workflow and are triggered BEFORE a workflow transition. The outcome of the script decides if the user can complete the transition and even if the user can select the transition as an option. The scripts can prevent users from performing actions if they are not permitted, add special security rules, validate input data, etc.



  • Workflow Post Functions:These scripts are triggered AFTER a workflow transition. Post Functions are the ideal place for adding actions that happen automatically like: creating sub-tasks, copying data from the parent, calculating field values, pushing data to a database, sending out custom notifications, etc. 



  • Listeners: Listeners are a lot like post functions in that they happen AFTER a workflow transition. The difference is that listeners do not live within the workflow and can preside over multiple workflows simultaneously. Listeners can also be triggered by other, non-workflow actions like simply editing an issue. They can also be triggered by non-issue events like when a new user is created, a project or version is created, and many other events.



  • Live Fields: Live Fields is a name given to the scripts that can be triggered when a user simply views an issue, or when the user edits an issue or tries to create a new one. The scripts can control the fields on the issue screen thus making the screen 'fields' seem 'live' since they can be hidden, disabled, pre-populated, tied to other fields, and more actions specific to the screens themselves.



  • Scheduled Jobs: Some scripts don't need to be tied to a user event at all and may just need to run periodically. These scripts can be scheduled to run at time-specific intervals, daily, weekly, or even something complex like the first Tuesday of the month. The types of scripts that are run like this usually work with issues in bulk. For example, an escalation service to raise the priority of issues that have gone past the due date or a script that automatically assigns issues created that day.



  • JQL Functions: Like anything in life, sometimes the hardest part about Jira is being able to find what you are looking for when you need it. Jira has a lot of JQL functions to help but they don't always get the job done. Power Scripts has some prewritten JQL functions to help. It is also incredibly easy to create your own custom JQL functions.

 

  • Service Management Automation - these scripts live right inside the native Service Management automation. When creating custom automation rules the scripts expand the possibilities of what can be used with the WHEN, IF, and THEN configuration within the automation rule.

 

  • Email Handlers: Sometimes you need more flexibility than what can be found by default in Jira. A perfect example of this is with the email handlers. By default, incoming issues go to a single default project and issue type. But, wouldn't it be nice to say, allow emails from specific clients to go into a separate project, allow keywords in the subject control the issue type that gets created, or to be able to parse text out of the body of the email into custom fields in Jira?

  • REST Service: These scripts can be triggered by external systems as part of an integration. And, outgoing REST calls can also be sent by scripts allowing for real-time 2-way integrations with external systems.

  • Webbooks: Custom URL endpoints can be created to allow external systems to send messages to scripts. It seems like all today's technology can communicate with each other, like turning your TV off with your phone. Behind the scenes, those types of integrations are done with webhooks.

  • SIL Runner Gadget: What about the times when you don't have a real hook or event within Jira? What about the times when you just what something to happen when you push a button? Well, the SIL Runner Gadget is here to help you. This handy gadget can create these buttons, and other custom UI elements, on a dashboard for the times when you just need a simple form and a button to make the magic happen. And the best part, these dashboards can be shared with other non-admin users as well.

  • Jira Start/Stop: How would you know if your Jira server went down in the middle of the night? These days you can get a text message when your potted plant needs watering so why not get a text when the Jira server goes down?

  • SIL Panel: The scripts run inside a custom section within a Jira issue. This lets you add custom content to the issue or even display custom charts and graphs. I use it to show the current weather forecast but you can use it for whatever you want!

 

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.