Project

Profile

Help

Create a custom workflow for recurring tasks » History » Sprint/Milestone 69

Jens Krämer, 02/25/2020 08:18 AM

1 1 Jan Schulz-Hofen
# Create a custom workflow for recurring tasks
2
3
Planio is not only great for [one-off projects](https://plan.io/project-management/). It really shines when it comes to [recurring tasks](https://plan.io/task-management/) that follow a certain workflow within your organization.
4
5 4 Jan Schulz-Hofen
Follow along this guide to create a simple vacation approval workflow for your team members - and apply what you've learned to create your own custom workflows.
6 1 Jan Schulz-Hofen
7
{{>toc}}
8 45 Jan Schulz-Hofen
9
## Planio workflow basics
10 1 Jan Schulz-Hofen
11
In Planio, every issue must belong to a tracker which defines its workflow. Let's look at this in more detail:
12
13
### Trackers
14
15
We'd like to see trackers as special issue types. An issue must belong to exactly one tracker. **Task**, **Support incident**, **Software bug**, or -- you guessed it -- **Vacation request** would be great examples for a tracker.
16
17
### Issue statuses
18
19
Issue statuses describe the different states, that an issue in Planio can have at any given moment. For instance, an issue can be **Open**, **In progress**, **Waiting for review**, or **Closed**. An issue will always have exactly one status and the status will likely change over time as people work on the issue.
20
21
### Roles
22
23 18 Jan Schulz-Hofen
Users in Planio have their own user account using which they take part in projects using one or more roles: While some users may take part as *Manager*, others may be regular *Staff* or e.g. *Client*. The role defines what a user can and cannot see or do in a given project. It also defines the user's workflow.
24 1 Jan Schulz-Hofen
25
### Workflows
26
27
The workflow brings it all together: A workflow defines for every possible combination of tracker and role which issue statuses are available. It defines for all its tracker's issues which status changes are allowed and which issue properties are visible and/or changeable.
28
29
Say what!? This is arguably the most complex (and powerful) part of Planio, but don't worry -- we will walk you through it and you will be a workflow expert in no time!
30
31 4 Jan Schulz-Hofen
## Technicalities of going on a vacation
32 2 Jan Schulz-Hofen
33
We knew you would love this section. Dreaming of that deserted beach in the Caribbean? Let's request some vacation days and off we go.
34
35
In many companies, taking a vacation requires approval by a manager. Employees must submit a request mentioning the start and end date of the requested vacation and managers will approve or disapprove the request. Upon approval, the dates of that vacation can not be altered, and the vacation request is final. If disapproved, employees can alter their requested dates and re-request approval until -- hopefully -- they will be allowed their well-deserved days in the Caribbean.
36
37 46 Jan Schulz-Hofen
We will now build this workflow in Planio allowing for actual vacation requests being made and approved. We will also show you how to visualise them on Planio's calendar, so you can get a great overview on who is on vacation at which point in time.
38 2 Jan Schulz-Hofen
39 4 Jan Schulz-Hofen
## Tracker, Statuses, Roles, and Workflow
40 2 Jan Schulz-Hofen
41 15 Jan Schulz-Hofen
To implement this, we will create a **Tracker** called *Vacation request*, three **Issue statuses** called *Open*, *Approved*, and *Rejected*, and two **Roles**, called *Manager* and *Staff*.
42 3 Jan Schulz-Hofen
43 1 Jan Schulz-Hofen
Finally, we will tie all those together using a custom **Workflow** in Planio.
44
45 9 Jan Schulz-Hofen
### Create the tracker
46 4 Jan Schulz-Hofen
47
First things first. Let's get down to business:
48
49 50 Jan Schulz-Hofen
  - Navigate to *Your avatar* -\> **Administration** -\> **Trackers**, then click on **New tracker**.
50 1 Jan Schulz-Hofen
  - Enter *Vacation request* as **Name**.
51 47 Jan Schulz-Hofen
  - Select *Open* as the **Default Status**.
52 9 Jan Schulz-Hofen
  - Uncheck the **Issues displayed in roadmap** checkbox since we do not want to see vacation days on our project roadmaps.
53
  - Uncheck all **Standard fields** checkboxes except the ones for **Start date** and **Due date**. We'll actually use those for the start and end of our vacations.
54
  - Do not select anything in the **Copy workflow from** drop down.
55
  - Click **Create**.
56
57 49 Jan Schulz-Hofen
{{figure(Your tracker should look like this.)
58 69 Jens Krämer
![](creating_a_new_tracker@2x.png)
59 49 Jan Schulz-Hofen
}}
60 9 Jan Schulz-Hofen
61
### Create issue statuses
62
63 10 Jan Schulz-Hofen
The steps are similar but slightly different for the three statuses *Open*, *Approved*, and *Rejected*.
64 6 Jan Schulz-Hofen
65 50 Jan Schulz-Hofen
  - Navigate to *Your avatar* -\> **Administration** -\> **Issue statuses**.
66 51 Jan Schulz-Hofen
  - Do you see a status called *Open*? Great, you can skip this step. Don't see it? Simply click on **New status**, enter *Open* in the **Name** field, and uncheck the **Add to all workflows** checkbox since we only want it for our *Vacation request* workflow. Then click on **Create**.
67
  - Create the remaining statuses *Approved* and *Rejected* following the same pattern and make sure the *Approved* status has the **Issue closed** checkbox checked.
68 23 Jan Schulz-Hofen
69 51 Jan Schulz-Hofen
{{figure(This is what your "Approved" status will look like.)
70 69 Jens Krämer
![](create_an_issue_status@2x.png)
71 51 Jan Schulz-Hofen
}}
72 14 Jan Schulz-Hofen
73
### Create a role
74
75 19 Jan Schulz-Hofen
This one should be easy:
76 14 Jan Schulz-Hofen
77 50 Jan Schulz-Hofen
  - Navigate to *Your avatar* -\> **Administration** -\> **Roles and permissions**.
78 17 Jan Schulz-Hofen
  - Do you see the roles *Manager* and *Staff* already? Great. You're done with this step. Those are actually the two basic roles your Planio account came with.
79 20 Jan Schulz-Hofen
  - Do not see the roles? Create them by clicking on **New role**. Enter the role's **Name** and ignore the rest for now, just be sure that the check boxes for permissions **View calendar**, **Edit issues**, **View issues**, and **Add issues** are checked. Repeat this for both the *Manager* and *Staff* roles.
80 21 Jan Schulz-Hofen
81 52 Jan Schulz-Hofen
{{figure(Adding a role)
82 69 Jens Krämer
![](how_to_add_a_role@2x.png)
83 52 Jan Schulz-Hofen
}}
84 22 Jan Schulz-Hofen
85
### Define the workflow
86
87
This is the fun part. Here is where it all comes together.
88
89 50 Jan Schulz-Hofen
  - Navigate to *Your avatar* -\> **Administration** -\> **Workflow**.
90 22 Jan Schulz-Hofen
  - Select the *Staff* role and your *Vacation request* tracker.
91
  - Uncheck the **Only display statuses that are used by this tracker** checkbox and click on **Edit**.
92 58 Jan Schulz-Hofen
  - The checkbox matrix that appears lets you configure all allowed status transitions for a given role and tracker. For instance, the *Staff* workflow should have the checkbox at the top and lower left checked. This means that members having the role *Staff* can create **new issues** with a status of *Open*. Additionally, they can set an issue having a **current status** of *Rejected* back to *Open*.
93 26 Jan Schulz-Hofen
  - Now, let's configure the *Staff* workflow according to the following screenshot:  
94 53 Jan Schulz-Hofen
    {{figure(Workflow for Staff role)
95 69 Jens Krämer
![](vacation_request_workflow_for_staff@2x.png)
96 53 Jan Schulz-Hofen
}}
97 26 Jan Schulz-Hofen
  - Click on **Save**.
98 1 Jan Schulz-Hofen
  - Next, select *Manager* as a role, make sure the **Only display statuses that are used by this tracker** checkbox is unchecked click on **Edit** again.
99
  - Configure the *Manager* workflow according to the following screenshot:  
100 54 Jan Schulz-Hofen
    {{figure(Workflow for Manager role)
101 69 Jens Krämer
![](vacation_request_workflow_for_manager@2x.png)
102 54 Jan Schulz-Hofen
}}
103 26 Jan Schulz-Hofen
  - Click on **Save**.
104 27 Jan Schulz-Hofen
105
Wait, what did we just do? Have a look at the screenshots again. What we defined is:
106
107
  - *Managers* can set an open vacation request to *Approved* or *Rejected* and a *Rejected* vacation request to *Approved* (in case they changed their mind). 
108
  - *Staff* can only set a *Rejected* vacation request back to *Open*. (This is for when they change their dates and want to re-request approval.)
109
110 68 Jan Schulz-Hofen
### Adapt field permissions
111 28 Jan Schulz-Hofen
112 27 Jan Schulz-Hofen
Now, let's customize the issue form fields a bit according to the issue status.
113 1 Jan Schulz-Hofen
114 28 Jan Schulz-Hofen
  - Still on the **Workflow** screen, select the **Fields permissions** tab.
115 59 Jan Schulz-Hofen
  - For *Manager*, set everything to *read-only* except the **Subject**. To save some clicks, you can copy a value to the entire row by clicking on the **»** symbol.  
116 60 Jan Schulz-Hofen
    {{figure(Fields permissions for Manager role)
117 69 Jens Krämer
![](fields_permissions_manager@2x.png)
118 60 Jan Schulz-Hofen
}}
119 35 Jan Schulz-Hofen
  - For *Staff*, do the same except for the **Start date** and **Due date** fields:  
120 61 Jan Schulz-Hofen
    {{figure(Fields permissions for Staff role)
121 69 Jens Krämer
![](fields_permissions_staff@2x.png)
122 61 Jan Schulz-Hofen
}}  
123 35 Jan Schulz-Hofen
    This makes sure only *Staff* can actually set the dates for a vacation request and that those dates cannot be changed anymore, once approved.
124 31 Jan Schulz-Hofen
125 40 Jan Schulz-Hofen
## Put it all to work in an actual project
126 32 Jan Schulz-Hofen
127
That's enough of prep work. Let's try it out.
128
129 62 Jan Schulz-Hofen
  - Start by creating a new project via **Projects** -\> **New project...**
130 33 Jan Schulz-Hofen
  - Give your project a name, e.g. **Vacation planning**.
131 63 Jan Schulz-Hofen
  - Disable all **apps** but **Issue tracking** and **Calendar**.
132 33 Jan Schulz-Hofen
  - Select only your **Vacation request** tracker and nothing else.
133
  - Click **Create**.
134
135
That's it, you're done. Your users can now use this project for your new vacation request planning workflow. In order to submit a vacation request, all they'd have to do is create a new issue. Selecting a **start date** and a **due date** will be required when creating *vacation request* issues and all other useless fields will be hidden.
136
137 65 Jan Schulz-Hofen
{{figure(Stripped down issue form for vacation requests)
138 69 Jens Krämer
![](new_issue_form@2x.png)
139 65 Jan Schulz-Hofen
}}
140 34 Jan Schulz-Hofen
141 66 Jan Schulz-Hofen
In order to try it out for yourself and play around with it, we recommend you create two users via *your avatar* -\> **Administration** -\> **Users** that have no administrator privileges and add them as *Staff* and *Manager* to your project respectively.
142 37 Jan Schulz-Hofen
143 41 Jan Schulz-Hofen
(If you try it out as an administrator, don't be alarmed by the fact that you can always choose from all statuses when updating an issue. That's normal if you're an admin. Regular users will only see the statuses as defined by their workflow.)
144
145 37 Jan Schulz-Hofen
### Bonus: The calendar view
146
147
What's up with the **Calendar** module we've enabled in the roles and your project, you ask yourself? Well, after adding a couple of vacation requests, check out the **Calendar** tab in your project. The Planio calendar will give you a nice monthly overview of all vacation requests which have been tracked.
148
149 67 Jan Schulz-Hofen
{{figure(Vacation calendar view in Planio)
150 69 Jens Krämer
![](vacation_calendar@2x.png)
151 67 Jan Schulz-Hofen
}}
152 38 Jan Schulz-Hofen
153 39 Jan Schulz-Hofen
By using a [custom query](http://plan.io/blog/post/25072622222/trackers-viewing-and-grouping), you can even create a calendar view that displays only approved vacation requests. Or create a query for your managers that shows only *Open* requests that have to be approved still.