The HR project

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 New Employee and Termination issue types will use customized workflow, while the Task issue type will continue to use the existing one.
  • For Termination issue type, we will add two additional steps, one to conduct an exit interview, and one to ensure that all necessary company assets are returned.
  • Ensure that only authorized personnel can transition the issue through the various statuses of the workflow.

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.

Setting up workflows

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:

  1. Browse to the View Workflows page.
  2. Click on the Copy link for the HR: Task Management Workflow workflow.
  3. Name the new workflow HR: Termination Workflow.
  4. Click on the Copy button to create our 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:

  1. Click on the Add status button.
  2. Enter the name for our new status as, 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.
  3. Click on the Create button to create the workflow status.
  4. Repeat steps 2 and 3 to create a new status called 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 DoIn Exit ReviewCollecting AssetsDone. Let's start with creating a transition going from To DoIn Exit Review:

  1. Click on the Add transition button.
  2. Select To Do as the From status.
  3. Select In Exit Review as the To status.
  4. Name the new transition as Conduct Exit Review.
  5. Select Workflow Screen for Screen.
  6. Click on the Add button to create the transition.
  7. Repeat steps 1 to 6 to create two more transitions, linking In E xit Review to Collecting Assets, and Collecting Assets to Done.
  8. With the new transitions in place, we will also want to remove the existing transitions between To Do and Done. So people cannot skip the process steps.

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:

Setting up workflows

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 9Securing JIRA, we can change this security setting:

  1. Click on the Conduct Exit Review transition and click on Conditions from the transition property section.
  2. Click on the Add condition button to bring up the Add Condition To Transition page.
  3. Select the User Is In Group option.
  4. Select the jira-administrator group.
  5. Click on Add to add the condition to the transition.
  6. Repeat steps 1 to 5 on the remaining transitions.

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.

Applying the workflow

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:

  1. Browse to the Workflow Schemes page.
  2. Click on the Edit link for HR: Task Management Workflow Scheme.
  3. Click on the Add Workflow menu and select the Add Existing option.
  4. Select our new HR: Termination Workflow option and click on the Next button.
  5. Select the Termination issue type.
  6. Click on Finish to create the association.
  7. Click on the Publish button to apply the change.

This associates our new workflow with the Termination issue type specifically created for our HR project and leaves the default workflow for the others.

Putting it together

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 9Securing JIRA. For now, we will simply add a new user to our system:

  1. Browse to the JIRA administration console.
  2. Select the Users management tab and click on the Users link.
  3. Click on the Create user button to bring up the Create New User dialog.
  4. Name the new user john.doe (John Doe).
  5. Set the password and e-mail address for this new user.
  6. Uncheck the Send Notification Email option.
  7. Check the JIRA Software option for Application access.
  8. Click on the Create button to create the user.

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 1Getting 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:

Putting it together

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 4Issue Management. You termination issue may look something like this:

Putting it together

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset