We have seen the power of workflows and how we can enhance the usefulness of JIRA by adapting to everyday business processes. With our HR project, we have already defined two issue types to represent the onboarding and dismissing of an employee, both of these use the same default workflow with two steps, To Do and Done. So, we will now customize the workflow to represent a real-world HR process.
Our requirements for the business process would then include the following:
The easiest way to implement these requirements would be to create a new workflow and add the additional process steps as new statuses. We will first do this to get our workflow structure in place. Later on, we will also look at how we can use other features in JIRA and incorporate them into our workflow to make it more robust.
The first step is to create a new workflow for our Termination issue type, since we still want to keep the existing workflow for the Task issue type. The easiest way to get started is to clone the current workflow to save us some time:
HR: Termination Workflow
.The next step is to add in the extra status we need. Make sure that you are in the workflow designer by selecting the Diagram option:
In Exist Review
, set the Category to In Progress, and click on Add. You will need to hit the
Enter
key on your keyboard, since we are creating a new status.Collecting Assets
.Now that we have our statuses added to our workflow, we need to connect them into the workflow with transitions. For now, we will make the workflow to go in a sequence in the order of To Do | In Exit Review | Collecting Assets | Done. Let's start with creating a transition going from To Do | In Exit Review:
Conduct Exit Review
.Your workflow will look something like the one shown in the following screenshot. You can rearrange the elements in the workflow to make the diagram flow more naturally:
The next customization we will do is to make sure that only authorized personnel can transition the issue along the workflow. For now, we will set it so only members of the jira-administrators
group can transition an issue after it is created. Once we cover Chapter 9, Securing JIRA, we can change this security setting:
Conduct Exit Review
transition and click on Conditions from the transition property section.jira-administrator
group.Using the Users Is In Group option will ensure that only users in the selected group, jira-administrator
in this case, will see the transition with the condition applied to it.
With our workflow in place and set up, we need to let JIRA know the issue types that will be using our new workflow. Since we already have a workflow scheme in place for our project, we just need to associate the appropriate issue type to the workflow:
This associates our new workflow with the Termination issue type specifically created for our HR project and leaves the default workflow for the others.
With our new workflow in place, we can now create a new Termination issue and start testing our implementation. Since we need to simulate a scenario where an "unauthorized user" cannot transition the issue after it is created, we need to create a new user. We will look at user management and security in Chapter 9, Securing JIRA. For now, we will simply add a new user to our system:
john.doe
(John Doe).JIRA Software
option for Application access.Now, log in to JIRA as a new business user, john.doe
, and create a new termination issue. After you create the issue, you will notice that you cannot execute any transitions. This is because you (john.doe
) are not in the jira-administrators
group, and you are currently, on the administrator user we created in Chapter 1, Getting Started with JIRA, is in the jira-administrators
group, so let's log in as the administrator. Once logged in as the administrator, you will see our new transition Conduct Exit Interview, as shown in the following screenshot:
You will also see that, if you create a new task in the HR project, the task issue will continue to use the default workflow.
With the current workflow setup, everything happens in a sequential order. However, sometimes, you might need things to happen in parallel. For example, in the collecting assets step, there might be multiple assets to be collected for various teams, such as a laptop for IT and key card for security. It will be a lot more efficient if you can perform them at the same time and be able to track them individually. One way you can do this is by creating subtasks for each asset under the issue (remember, an issue can only be assigned to one person), and assign the subtask to the relevant team such as IT and security, so they can chase up with the employee to retrieve the asset. You can then set a condition on the Done transition to make sure that all subtasks are completed before they can be executed.
This can be expanded upon to have asset collection and exit interview as subtasks so that both can happen at the same time, and you can create different subtask issue types to differentiate them, as covered in Chapter 4, Issue Management. You termination issue may look something like this: