Customizing Jira Workflows Slides and Notes
Customizing Jira Workflows Slides and Notes
The course is developed primarily on Jira Software Server but much of the workflow concepts
and the workflow editor is the same or equivalent on other platforms and Jira applications.
However, some of the Marketplace app solutions may not be available for all combinations of
hosting options and applications.
Additionally, functionality specific to Jira Service Desk is covered in brief in its own module on
Service Desk Approvals and Automation. In the online assessment, questions about Jira
Service Desk will be specifically referenced.
Note the different colors of each status. Each color represents a status category – To Do
(blue), In Progress (yellow), and Done (green). You’ll see these colors in all types of workflows.
These help you identify where issues are in their lifecycle, particularly in places where a large
number of issues are rolled up together.
Resolution should always be set when an issue goes to its final status, and it should be cleared
when an issue is reopened again. In this workflow, the house-building task will never be
reopened.
It is crucial to remember that Jira considers an issue to be resolved if its Resolution field has a
value, regardless of the actual workflow status it is in. And Jira considers an issue to be
unresolved, if its Resolution field is empty.
You can use transition properties to do things like translate buttons, so foreign companies can
estimate a house-building project.
Here you see the Dev Workflow Scheme is associated with a single project, Space Programs.
There are four workflows used in this scheme. Bugs use the Bug Workflow. Stories use the
Story workflow. And both Tasks and Sub-tasks use the Task Workflow. All other issue types
available in this project, if any, are mapped to the Dev Workflow.
Notice that multiple issue types can be mapped to the same workflow.
An extra layer exists in Service Desk projects, where Request Types are first mapped to Issue
Types. We will explore this later.
Each project which is newly created from a project template gets a set of schemes based on
the default schemes for its project template. Some of the associated schemes are shared with
other projects and some, including the Workflow Scheme, are unique to the project. This
means that they can be modified and the changes will not affect any other project.
Bottom line, when created from templates, projects get default workflows which are unique to
those projects. They are not shared with other projects unless later changed. Let’s look closer
at these defaults.
A set of default statuses are used by the default workflows, including To Do, Open, In
Progress, Under Review, Done, Closed, Cancelled, and others.
Note the connection between columns and workflow statuses. Columns can have the same or
a different name than the mapped status. And multiple statuses can be mapped to the same
single column, as shown here, where both Resolved and Closed statuses are mapped to the
Done column.
It’s crucial that you map all statuses to columns. Otherwise issues in unmapped statuses will
be hidden from the board.
Board administrators can configure the columns. They can add, remove, rename, delete
columns and change the status mapping so it better represents the workflow and clearly
shows where in the process the work currently resides. To add a status to a board, the project
must be using the Simplified Workflow. Adding a status to a board adds a status to the
underlying workflow. We will discuss this later in the presentation.
These requirements could be met by adding Conditions, Validators, and Post Functions to
various transitions in a custom workflow. And throughout this presentation, we will learn how
to do that.
Different apps are available for Cloud, Server, and Data Center hosting options. Some apps
are free and others are paid.
Note that you need Jira System Administrators global permission (not just Jira Administrators
permission) to update or install an app.
This presentation mentions workflow solutions that rely on the use of Marketplace apps. We
will not be mentioning the vendors by name, since your requirement will differ and multiple
vendors sometimes offer similar functionality. So be sure to check out the Marketplace and
compare.
Note that you can also create your own conditions, validators, and post-functions by building
your own app, but we don’t cover it in this presentation.
In this example, Start Design transition goes from New Plan to In Design. If we wanted to go
back to New Plan, we would have to create a different transition.
But you also need the option to Cancel the Project when In Estimation phase. Instead of
creating a second transition with identical configurations, you can simply choose to reuse the
one configured earlier. This makes it easier to maintain in the future, and less error-prone
when business requirements change.
One common use of such self-reflecting transitions is to allow only some users to edit one or
more restricted fields, which are available only on a transition screen which is hidden by a
permission condition. We will look at such an example once we learn more about conditions
and transition screens.
Conditions control either who performs a transition or under what circumstances. In this
example, Teams in Space want only developers to be able to send an issue for code review.
This can be achieved by adding a condition to the “Code Review” transition. So only the users
who are in the Developers role can see this transition. But remember that users also need the
'Transition Issues' permission to see and execute transitions at all.
If a condition fails, the user will not see the transition button when viewing the issue, and
therefore not be able to execute it.
Conditions can take into consideration whether the user is the reporter, assignee, or in a
particular project role or group. For example, you can restrict an approval transition to only
users who are in the approvers project role. Conditions can also check the user’s permissions.
For example, does the user have the Resolve Issues permission?
Conditions can also take into account something about the state of the issue. For example, has
code been committed against this issue? Or the status of the issue’s Sub-tasks. For example,
you can restrict the parent from transitioning to Done until all of its Sub-tasks have been
Resolved or Closed.
In short, groups are used across Jira, whereas roles fulfill particular functions within a project.
First, Jira administrators must create the project roles. But once created, project role
membership is project-specific whereas group membership is always global.
Project administrators can therefore manage membership (on a project by project basis), so
changes can be made quickly if membership changes. This takes the load off of Jira
administrators, because they are the only ones who can manage groups.
And finally, roles help to reduce the number of schemes because schemes can be more
generic and therefore shared.
Groups are global across Jira, so unless you created different groups for each project you
couldn’t achieve the same flexibility. You might also have to create unique workflows.
Additionally, Project Administrators can modify membership in roles, but not in groups.
Bottom line, project roles are a much more flexible and sustainable. As a best practice, use
project roles instead of groups in workflow conditions and validators.
In this example, the only users who can execute this condition are EITHER the Reporter who is
also in the Managers project role OR members of the Sales group.
But then we look at the outer grouping which says that “all of the following conditions” must
be true. This means that in addition to the above, the third condition validates existing issue
links. If issue links of the specified link type exist, namely “is blocked by”, then Jira checks
whether they respect the constraint that their status must be in Resolved or Closed.
The most common use case involves making fields or comments required on specific
transitions as the issue progresses through its lifecycle. Making the field required through field
configuration makes it required from the beginning, but some values are not known until a
later time. So that is why Fields Required validators are useful later in the workflow process.
In this example, the developer must enter the Time Spent on the issue when submitting an
issue for code review.
These are not the only screens in Jira. Users interact with data when they create, edit, and
view issues, as well. These three issue operations (Create, Edit, View) are mapped to screens
via a Screen Scheme, and to an issue type via Issue Type Screen Scheme. But in this
presentation, we focus only on Transition Screens.
Jira supplies some transition screens built into the default workflows, for example, the
“Resolve Issue Screen” which is shared by all new Software projects and is used for all issue
types in the workflow.
Only Jira administrators can create custom transition screens, and associate them with
workflow transitions.
Note that you can actually use any screen as a transition screen. You could, for example, use
the Create Screen from a project as a transition screen. But as a best practice, you want to
include only the fields that should be entered or modified during that transition. Otherwise,
the transition screen becomes too cluttered and is frustrating to users.
One other common use case for these self-reflecting transitions is to restrict editing of some
fields to some users. For example, let’s say that the requirement is that only the Home Owner
should be allowed to edit the Budget field after the house-building request is created.
Everyone else should just view it. But everyone else should be able to edit the other fields.
Jira does not have field level permissions, so how can we achieve this requirement?
Here is how to meet that requirement in more detail. The Budget field is placed on the Create
Issue and View Issue screens, but not on the Edit Issue screen. The Budget field is also placed
a transition screen. A self-reflecting transition called “Modify Budget” is created on the New
Plan status and it loops back to the same status. The transition has a condition that only the
Home Owner (i.e. the Reporter) can execute this transition.
The result is that only the Home Owner can see the transition and thus modify the Budget field
which is on the transition screen. Everyone else can just view the Budget Field. The only
purpose of the self-reflecting transition is to restrict the ability to edit the Budget field after
issue creation from everyone but the Reporter.
But you can put other fields on a Transition Screen and require them with a Validator.
Transition screens, plus validators, provide a way to make fields mandatory at any point in
your workflow, rather than at the time of issue creation. This also provides the flexibility to
clear field values on a certain transition and then make them mandatory again later in the
workflow. To make a field mandatory during a workflow transition, you use a validator and a
transition screen together.
In this example, a post function clears the Resolution field after the Reopen transition has
executed, which moves the issue from Done back to To Do.
Here on the left, you see the first option. When going from In Progress to Done the user is
prompted to select the Resolution as either Duplicate, Fixed, or Won’t Do.
On the right, you see the second option. There are 3 outgoing transitions from the In Progress
status to 3 different statuses. Each one sets a different Resolution automatically. The
Resolution is set automatically to Duplicate when going to the status Resolved. It is set to
Fixed when going to Closed, and to Won’t Do when going to Cancelled.
Remember that Jira sees the Resolution field as a flag. If it has a value, then the issue is
considered resolved. If it's empty, then the issue needs some form of action, and is therefore
considered open. This is very important, because Jira uses Resolution on various gadgets and
reports. All transitions that resolve an issue should set a Resolution value, either automatically
via a post function or from user input via a transition screen.
These essential post functions cannot be deleted from a transition or reordered. However, you
can insert other (optional) post functions between them.
Suppose you had a Tax project with a workflow to handle tax returns. In some cases, the
assignee will click a transition called “Audit Required” to move the issue from Under Review to
Pending Audit. This is the only time that auditors should be notified, and not every time that
returns are updated, commented, and so on.
Here is how the process works. First the Mail Listener picks up and processes the event.
It worth nothing that there is one more important step not pictured here. Before sending the
email, Jira must also check the permission scheme and the issue security scheme associated
with the project to make sure that Auditors group do actually have permissions to view the
issue.
There are 17 system events as shown on the left. These include Issue Created event, Issue
Updated, Issue Assigned, Issue Moved, Issue Deleted, and many others. On the right, you see
examples of custom events, such as Awaiting Response and Pending Audit which may be
added globally by Jira administrators. You don’t have to have custom events in a Jira instance,
but business requirements may warrant it, as we explored earlier.
In a workflow transition, you can add a post function called “Trigger a Webhook.” In the
example pictured here, when an audit is required, a webhook is triggered to automatically
assign tasks to Auditors in a remote auditing application.
If the webhook you choose is also configured to listen to events, then the webhook will be
triggered twice: once for the event and once for the workflow transition. For this reason, you
should always unselect all events from the webhook admin screen.
When a trigger is executed, the conditions and validators are ignored and only the post
functions are executed. This means that any permissions on who can transition the issue are
completely ignored.
You can still drag issues between columns on the agile board or update your status manually
using the workflow buttons in the issue. And in that case, permissions, conditions, and
validators are still respected.
Workflow automation triggers simply provide more options for how issues move from one
status to the next, as well as provide assurance that the current status reflects the actual state
of development. Before you can start using triggers, a Jira admin needs to connect your
development tools to Jira. Then configure triggers in Jira workflows that respond to events in
the linked dev tools.
Another transition, simply named Progress, can be invoked by a trigger from a dev tool. It
won’t have conditions and validators because they would be ignored anyway. In order not to
confuse users and keep it simple, you can use a condition to hide this particular transition
from the user, since it will only be triggered from a dev tool. There is a condition called “Hide
transition from user” which will hide it.
Notice the number 1 next to the Triggers tab on the transition. And there are no conditions or
validators. If there were, they would be ignored. The Branch created trigger automatically
transitions the issue when a related branch is created in a connected Bitbucket repository.
We will now look at some common examples. But use properties sparingly and only when
business requirements warrant them, as they’re hard to maintain and can easily confuse
inexperienced administrators.
In the bottom example, you can restrict commenting when the issue is in the status Awaiting
Release by setting the property “jira.permission.comment.denied” as shown.
Using the ‘permission’ workflow property, you can restrict permissions at the status level. You
can restrict various permissions to a project role, group, user, and more when an issue is in
that status. You restrict WHO can do what to an issue and WHEN they can do it. The best
practice is to use project roles.
Workflow properties allow you more granular control of permissions than permission schemes
but they are also harder to maintain. Also note that you cannot use permission properties to
grant more permission than what is allowed by the permission scheme, instead you are further
limiting what is allowed by the permission scheme.
Using the ’opsbar-sequence’ property, as shown on the left, you can change the sequence of
available transitions when viewing an issue. It is more intuitive to have the most used transition
first, for example to see Approve transition before Reject or Cancel.
There is also a property that enables you to limit the resolutions on a workflow by workflow
basis. Instead of listing all nine default resolutions defined in Jira administration (or more, if
your system has grown over time), you can show just a few, or all except for one. Or only one
or two. Here you see the property “jira.field.resolution.exclude” excluding two of the available
Resolutions from being shown to the user on a transition screen.
You can also use i18n properties to translate the text of the buttons on screens for transitions.
The initial transition is called 'Create' (if you created a blank workflow) or 'Create Issue' (if you
copied the system workflow).
You do not have to begin a workflow in the Open status. You can simply redirect the Create
transition to go to a different initial status, such as New Candidate shown in the image on the
right.
Notice that in the workflow editor, you do not see the Conditions tab, to the left of Validators.
The validator says that “Only users with Create Issues permission can execute this transition.”
Jira just looks at the Create Issues permission in the project’s Permission Scheme to
determine who is allowed to create any issues in the particular project which uses this
workflow.
Therefore, it is not normally possible to set create permissions per Issue Type in Jira. But there
is a workflow customization that can be done, via a Marketplace app, to work around this
limitation, by inserting a different validator in the "Create issue" transition. This is reviewed in
one of the requirements in the next section.
Also notice that there are 3 essential post functions that are specific to a workflow's initial
transition but additional optional post functions can also be added to an initial transition.
But Post function webhooks do not fire if added to the Create Issue workflow transition. We
recommend that you configure your web hook to fire from the issue_created event instead.
There is another transition called “Start Review”. There is a Trigger configured on this
transition. When a review is started in Crucible, the related Jira issue is automatically
transitioned from In Progress to In Review.
And finally, there is a Step Property configured on the In Review status so that no one can edit
while the code is being reviewed.
You can add a Post Function there to Close the parent issue automatically once all Sub-tasks
are Resolved. When each Sub-task gets Resolved one by one, a post function checks the
status of sibling Sub-tasks. If they are all Resolved, then it can transition the parent issue
automatically to Done (using the Close transition on the parent).
Here is our first requirement. What if you want to force the user to modify some field (Due
Date) while rescheduling a Task, using the Reschedule transition. Do we need a Condition,
Validator, or Post Function here?
Other use cases include transitioning all "Blocked By" issues to In Progress status when the
"Blocks" issue is Resolved. Or transitioning the parent issue to On Hold when a Sub-task is
placed On Hold. You can also trigger a transition on the current issue to move it one step
further in its own workflow.
However, we can satisfy this requirement by inserting a validator on the initial Create
transition of a workflow.
To achieve this, we can add the Create a Linked Issue post function, which allows you the
create new issues, copy fields from the original to the new issue, and connect them with an
issue link.
Such a post function can also create issues related to each other, such as creating Sub-tasks,
or creating Issues in an Epic.
Remember that fields can be made required via the field configuration, but this will make them
always required, wherever and whenever they appear on screens. Another way is to use a
transition screen and a fields required validator. This will make the field required always
during that transition.
But here we want to make the Fix Version/s field conditionally required during a transition –
only when the resolution is set to the value Fixed.
So we need to require a field based on the value populated in another field. How can we
achieve this requirement?
JIRA Service Desk provides a set of default request types configured for each project
template. You can configure the default request types or add new ones as needed. Each
request type in a service desk is based on a Jira issue type.
Note that a single JIRA issue type can be the basis for many different request types. In this
example, “Get IT help” request type and “Set up VPN to the office” request type are both
mapped to the single Service Request issue type.
In a Service Desk project, therefore, Request Types are mapped to Issue Types, Issue Types
are mapped to Workflows in a Workflow Schemes, and the Workflow Schemes are associated
with projects.
Approval transitions don’t display screens on the Customer Portal, so a Resolution should be
set automatically if the request goes to a Done status.
You must choose who can approve the request. You can have customers choose approvers
from a list, or you can send requests to a pre-set list of approvers. For example, the customer
can search for their manager in a list. Either way, a User Picker field used for approvers must
be added to the request form. By default, projects come with the Approvers field, but a
different field can also be created and configured. If the user is shown on the request type,
customer can choose approvers. But you must first ensure that customers can search for
them. Go to Project Settings > Customer permissions and make sure the setting “Who can
customers share request with?” is set to “Any customer or organization, by searching in this
project.” Or otherwise, you can set up a pre-set list of approvers by adding a user picker
custom field to the request and clicking Actions > Hide. Then enter the users who can approve
the request and click Set. The pre-set approvers will automatically display in the issue and be
notified when the request needs approval.
You also choose the required number of approvers - whether to consider the request
approved after all approvals or a certain number of approval(s).
Finally, you choose the approved and declined transitions. Note also that multiple approval
steps can be configured in a workflow.
For example, if the request is currently in the status Waiting For Customer, and the customer
adds a comment on the Customer Portal, then the request is automatically transitioned to
Waiting For Support.
The second one is “Triage requests sent by email.” It automatically sets the right request type
based on keywords in the requests sent by email.
It’s worth noting that you can use both together – you can make customizations to default
Service Desk workflows, and also take advantage of automation rules, because not everything
can be achieved with Service Desk automation. Just be careful to understand what could
conflict. And of course, not all projects are Service Desk projects. But if you have a choice,
then try to use the automation rules.
Let’s now look at an example of how the same business requirements can be achieved both
ways – using customization or using automation.
You would edit the workflow of the original issues and add a post function or two, from a
Marketplace app, in order to add a comment to all linked issues of a particular link type
(duplicates) and then to actually transition those duplicate issues to their resolved status. To
accomplish this, you need to be a Jira Administrator and have a Marketplace app, and it takes
quite a few steps to accomplish: first to create and then to maintain.
The rule runs immediately when triggered. And you can further customize it, as well. It comes
natively in Service Desk and is easy to configure, modify, or disable in the future.
By default, rules can trigger other rules. You may need to disable this to prevent rules from
triggering each other, which could lead to infinite loops.
And finally, test and evaluate the automation in a staging environment first before applying in
production. We’ll talk more about that in the upcoming module.
Board Administrators, who are also Project Administrators, can add Statuses to a board, if the
board is using the Simplified Workflow. They would add the status and map it to a column
accordingly.
Again, adding a Status to a board is only possible if the board uses the Simplified Workflow, and
the workflow cannot be shared. And once again, the Board Administrator must also be a Project
Administrator.
Aim to use a small set of standard workflows. For example, there’s no need to have twelve
software development workflows when most of your dev teams follow the same process.
Start simple and add on statuses, properties etc., only when the requirements warrant it.
To edit workflows, you can use either diagram mode or text mode. Diagram mode is easier to
understand and work with, especially for beginners. Text mode is a bit more advanced and
shows the difference between steps and statuses. Either way you choose, you should finalize
the diagram for end-users, so it appears intuitive when they click on the View Workflow link
on an issue.
An inactive workflow is one that is not currently being used by any projects. It must first be
activated. Because there are no issues currently transitioning through an inactive workflow,
you can easily modify steps and statuses.
Inactive workflows need to be activated to use them in Jira. Activating is the process of
mapping the workflow to a workflow scheme, and then associating the workflow scheme with
a project. Issues will then need to be migrated, as we will see shortly. This is done by Jira
Administrators.
Check before removing a status from a workflow, that it’s not being used in other places, like
filters and dashboards.
Removing a status from a copy of an active workflow will cause issue migration when the
modified workflow is associated with a project. At that time, Jira will check if there are issues
in the status that was removed. That means migrating issues.
But note that not all workflow functionality will be exported/imported, depending on the
format and use of apps. Importing XML workflows is supported for Server only.
Step through each status and transition, checking if all Conditions, Validators, Transition
Screens, and Post Functions behave as expected. Check Triggers and their connected
Development Tools. And see if the right event was fired and the right notifications were sent.
You may need to use virtual users to test different permissions and memberships in groups
and project roles.