Workflow Functions Tutorial
For a video on workflow functions, see the Workflow Functions training video.
ScriptRunner for Jira Server uses scripted versions of workflow functions to extend and customize the automated tasks available in Jira workflows. These workflow functions include scripted validators, scripted conditions, and scripted post functions. As with many features of ScriptRunner, you can select from built-in options, you can customize the built-in functions, or you can write your own. These scripted workflow functions allow you to do a lot more with your Jira workflows and further enhance your automation.
Review of Workflow Functions
As a reminder, a workflow is the series of steps through which a piece of work passes from conception to completion. In Jira, workflows are made up of two main parts: statuses and transitions. Statuses indicate that someone is working (or not working) on the issue, while transitions link statuses together. You can control several aspects of a transition’s behavior in Jira. For instance, you can have:
Conditions that check to make sure the user should be able to perform a transition.
Validators which ensure that all needed changes have been made or that the changes that were made were valid.
Post Functions that program automated actions after the transition is performed.
These workflow functions enable a level of automation in your projects. This automation keeps your teams focused on their work, while Jira takes care of the repetitive tasks your team doesn’t need to focus on. However, you may find that Jira’s basic workflow functions don’t always do as much as you would like them to do-- and that is where scripted workflow functions come in!
About Scripted Workflow Functions
For each of the Jira workflow functions, ScriptRunner for Jira provides scripted versions, so that you can suit your workflows to your exact needs. There are three main types of scripted functions: script validator, script condition, and script post function. Each of these functions provides you more ways of operating with your Jira workflows and getting those manual tasks handled by Jira.
For example, you can use the All Sub-Tasks Resolved built-in script condition to ensure that all sub-tasks have been resolved the attached transition is allowed. You can also update this sub-task-based script condition to include a specific issue type, certain subtask type, or other fields by updating the script with those specifics.
To access scripted workflow functions, go to the Workflows administration page from the Administration menu and Edit a workflow.
For detailed instructions on how to navigate to ScriptRunner workflow functions, see our documentation.
Your next steps depend on if you edit a workflow condition, validator, or post function. Remember when editing a workflow, changes result in a draft that you must publish before you see them take effect in your workflow. Since you can use both built-in scripted workflow functions and scripted workflow functions that you customize, there is a lot of flexibility to what you can do with ScriptRunner.