A post about why our programmers now do not fill in the timesheet 32, but only 2 minutes and how you can set up an automatic time tracking by importing data from the TFS, Redmine and Jira tracking systems to Microsoft Project Server.
The article will be of interest to project managers, heads of development companies, as well as programmers interested in the integration of various project management systems. ')
The problem is mess in filling out the timesheets
For 99% of software development companies, working time accounting for programmers is needed as air to count costs. Therefore, many force employees to fill in timeshields (timesheet, a kind of - time sheet). Often this means manually filling in a table with tasks and time spent on them.
99% of programmers, to put it mildly, dislike this procedure. Still, there is a great prospect for Friday evening - 30 minutes to sit and stupidly copy-paste all of your tasks for a week from the tracking program into timeshare. And, as you know, when people do stupid and hated work, the result is so-so. In our company, half the timeshats on Friday night were far from perfect. What was it expressed in?
First of all, the timeshields did not reflect all the “combat” tasks that were solved by the developers. The programmer could write that just all 40 hours worked on such a project. Or could tasks from one project be mistakenly attributed to a timesheet to another.
To combat all this disorder, an excellent employee from the project office (a photo of which would undoubtedly embellish the article, but we still won't publish it) gently, but relentlessly pressing 100 people half a working day on Monday. Then, according to a long check-list, I checked 1200 table rows of all timeshits. And only by Tuesday the management had a complete picture.
Result: with a delay of 3 working days, the managers finally received a report on the working time spent last week.
As it was. The procedure for collecting timesheets.
More than three days
The solution is to automate the process of filling the timesheets.
The solution of the problem crystallized gradually. We reasoned like that. If a programmer fixes all his work in the tracker, then why not take data on tasks and the number of working hours directly from there? This will allow you to quickly receive information for the analysis of labor costs, personnel workflow and other managerial tasks. Then it was a matter of small things - to find a beautiful technological solution for integrating our trackers with a system in which we take into account working hours (Microsoft Project Server - read more about it here ).
As it became. The timesheet filling procedure
Up to 100 pieces in 2 minutes! The maximum data collection time is 2 hours and 10 minutes.
What did we get?
A magic button appeared in MS Project Server, which allows you to do timeshift in 2 minutes. You come on Friday in Project Server, it automatically builds timeshams according to the data from the tracker for the week. There it remains to add only data about time off, vacation, sick leave, if there were. And voila - you press the button, you confirm that everything is correct, and the timeshit is ready.
I must say that the magic works only for those who observed the technology of project management in the tracker all week: fixed tasks, as well as planned and actual time for their implementation. These good guys on Friday get a plus in karma and automatic time-filling.
Automatically completed timeshit
Magic button bonuses
1. Saved 200 working hours
If earlier an employee took 30-40 minutes to fill out the timesheets, now it's 2 minutes. And if you count per 100 people per month, then we saved about 200 working hours.
Here you can add another 32 working hours, which were spent on checking the correctness of filling of timesheets, instead of which now takes only 4 hours a month. Saving time is explained simply: now real-time tasks are unloaded from trackers, and not those that people have hammered into their hands.
2. We quickly get analytics on projects for the week
Now at 19:00 on Friday, 91% of timesheets are completely filled, and managers have an analyst of project labor costs at the end of the week. Previously, by this time less than half had been collected.
Friday, 19:00The number of fully completed timeshits
3. Consolidated standards for the management of all projects.
Now in all tracking systems all projects, clients and other data are designated uniformly. Everywhere numbers on planned and actual time for performance of tasks are put down. This reduces our risks and improves project manageability.
4. Simplified control over how project management technology is respected.
Previously, in order to understand how a project was being conducted, it was necessary to manually look into the tracker. Now the control is done automatically when sending timeshit. For example, if the status of tasks and the time for their execution are not set in Redmine, then these tasks simply will not be uploaded to the timesheet. And vice versa, if the project office sees correctly filled timesheet - this confirms that its author has filled in all the fields in the tracking program.
In fact, at the exit we received a reengineering of the entire business process. Equipped the work as it is convenient for us, with our complex large projects.
5. We get analytics on any parameters already on Friday
If earlier the analyst for the last week came to the managers only on Tuesday-Wednesday, now already at the end of the current week, on Friday evening, 90% of the information on the timesheets is collected. Based on its built OLAP-cube.
How many bugs in a week have been fixed? How many hours did each project take? Where are the bottlenecks and why? Analyze data is now possible more quickly. But this is not the limit. Next time we will talk about how you can get a summary of all projects from trackers in real time using the improved version of our OLAP-cube.
And now the details, the meat and pieces of code.
Automate the business process step by step
Step 1. Standardize project management in different tracking systems.
The challenge was that the company used three different trackers (project management systems) to manage projects that were different in terms of technology. This is dictated by the requirements in terms of technology and the specifics of the projects themselves.
Project management in development departments - specialized tracking systems
Time tracking and analysis of business processes in the company
TFS is for Microsoft technology.
Microsoft Project Server - a system for managing project portfolios
Jira - projects in which the customer also uses the Jira system.
Redmine - for the department of mobile technologies, Java-developers and designers.
Standards of project management in different trackers were slightly different. For example, different workflows could be accepted for different projects. Or, a complex project for the same customer could be called “Mobile for a cool client N” in the mobile development department (in Redmine), and “N company’s internal website” in the web development department (in TFS).
For integration, this whole zoo had to be combed - to ensure that the identical projects were given the same name in each system, the time of task execution was specified everywhere and the general reference methodology was applied.
At the technology level, this required some features to be added to the trackers themselves. For example, in TFS there is no column in which you can enter the number of hours that you spent on a task on a specific date.
Step 2. Write a page that imports entries in MS Project Server
We will tell you how to make such a page. Outline a brief outline of what you need:
Add a button to MS Project.
Log in to the tracking system and read data on labor costs from there.
Display the received data to the user for verification.
Write data to MS Project.
2.1. Little button.
Let's look at how you can extend the interface of MS Project Server. Since, as everyone knows, MS Project Server runs on top of MS SharePoint Server, you can use the capabilities of the latter to add various elements to the MS Project interface. In particular, we needed the user to start the import directly from the timesheet page. To do this, you can add a special button in the Ribbon timesheet and associate it with the corresponding action. In order to be able to deploy this in MS SharePoint, you need to create a Feature that contains a Custom Action type element.
<CustomActionId="EBT.MSP.TimesheetSync.ImportFromRedmine.CustomAction"Location="CommandUI.Ribbon"Title="Import data from RedMine" > … </CustomAction>
Inside this CA, we define the appropriate extension.
The only problem that can arise is how to calculate the mentioned Location. We want the button to appear here.
There is not a lot of information on the Internet on this issue, therefore the main source of information is the pwaribbon file. The file is quite large, but you can understand it. After we have found the desired Location, everything is simple:
Add a button to it.
<ButtonId="EBT.MSP.TimesheetSync.Import.ANCHOR.RedmineButton"LabelText="Import from Redmine"Image16by16="/_layouts/15/EBT.MSP.TimesheetSync/img/rm_small.png"Command="EBT.MSP.TimesheetSync.Import.ANCHOR.RedmineButton.Command"TemplateAlias="o1" />
And determine the appropriate command.
<CommandUIHandlerCommand="EBT.MSP.TimesheetSync.Import.ANCHOR.JiraButton.Command"CommandAction="javascript:function ProjectCenterExtension() { var _grid; // Display surface (a view) of the JS Grid. var _satellite; // Control wrapper for the JS Grid. var props = window.timesheetComponent.get_TimesheetSatellite().get_impl()._pageProperties; window.location = '_layouts/15/EBT.MSP.TimesheetSync/ImportTimesheetData.aspx?ts=' + props.tsUid + '&prd=' + props.prdUid + '&datasource=jira_ebt'; }; ProjectCenterExtension();" />
As you can see from the above code, the command simply redirects the user to the appropriate page of type ApplicationPage. This page we wrote ourselves. Actually, inside of it, all further "dirty" things happen.
Namely:
Authorization in the tracking system and data reading.
Displays this data on the page so that the user can see what is added to his Timesheet.
Record information in MS Project.
2.2. Reading data
There were two problems:
1. How to log in to trackers to receive data. 2. How to compare the MS Project user with the tracking system user.
Globally, there are 2 approaches. Looking ahead, we say that we had to apply both approaches for different trackers:
Create a certain superuser who can get all the data from the tracker. And then try to match the user names of MS Project Server and trackers.
"Forward" authorization from MS Project Server to the tracker. There is an obvious plus here - the mapping is not necessary, you can simply get the user's records by his “forwarded” account. But with this and some problems, which a little later.
Solution for Redmine and TFS In our particular case, these trackers "live" in our infrastructure, so we decided to go the first way.
In the case of Redmine, everything is simple - in Redmine there is a Log Work function that works exactly as it should. That is, a person can enter the task and note how many hours he spent on the task of such and such a number.
Next thing is to make a presentation in the Redmine database (Redmine uses MySQL), and everything is ready. Problem solved, we can get data.
In the case of TFS, things are a bit more complicated. There is no such opportunity as in Redmine. There are certain Add-Ins that give it, for example, www.tfs-timetracker.com is an interesting thing, although not cheap.
But it is possible to approach this task from an organizational point of view. How? In TFS there is a field Completed Work, in which developers must record the total hours spent on the task. In Scrum-type project templates, this field is hidden, but it can be displayed. Further, in the Work Item change history, you can track the change in this field and understand when the clock was added, when, by whom and how much time was spent. Of course, this requires very tight work with the tracker from the developer. He cannot report backdating time, but, nevertheless, if everything is done on time and accurately, then this approach works very well. Moreover, it makes developers behave more disciplined.
Jira In our case, JIRA is “hosted” in a third-party environment. Therefore, we do not have a superuser or access to its database. But in JIRA there is a wonderful REST API that provides what you need ( https://docs.atlassian.com/jira/REST/cloud/ ).
To read data, you need to log in via OAuth. After starting the import from JIRA, the person is redirected to the JIRA authorization page, authorized there (if the user has not been authorized yet), and then returns to the import page.
(Unfortunately, JIRA only supports OAUTH 1, which is currently a bit old, but you can break through.) Having received the OAUTH token, we:
1. We take out the name of the author method
api/v2/myself
And so no name matching is necessary, we just take the user who logged in to JIRA.
2. Next, we look for all the tasks for which the user pledged time in a certain period.
api/v2/myself/search?jql=worklogDate>={start_date} and worklogDate<{end_date} and timespent>0and worklogAuthor={author}&fields=summary,project,parent,timeoriginalestimate,{pswa}&startAt=0
At first glance, this is all that is needed, but not quite. MS Project supports work in delegate mode, when a person does something on behalf of another, and our managers actively use it. Certain collisions happen here, of course, because if person A personifies person B in MS Project (usually the manager is a subordinate, or the person in charge is an employee), then in JIRA he does not personify him, but remains himself. And with such a request, he will receive tasks assigned to himself, that is, person A, who will be recorded in the timesheet person B. Moreover, unfortunately, there is no method (or we did not find it) to get all the tasks for all projects in which specified user has logged their work. And that's not all - man A may not have at all in JIRA the appropriate authority to read the necessary tasks. However, the last question can be solved organizationally.
In order to sort through all the tasks, you must first get all the projects using the method:
api/v2/project
Then run through all the projects and get all the tasks.
For each task found, get the pledged time and choose what falls in the right period and belong to the right author.
api/v2/issue/{id}/worklog
In this case, the problem of matching names again, of course, greets us cheerfully. In addition, this process takes a lot of time. Much better, probably, here and not come up with, however, if there is a better solution, they would be glad to hear.
2.3. Display data.
There is nothing special to tell - the code on the good old ASP.Net, which draws the data.
2.4. Writing data to the Timesheet
So, we went to a special page, logged in, got the necessary records, it remains to write them in MS Project. In fact, MS Project has several types of APIs, but since we work inside it, we used the same one that the Project’s pages use. This API looks, let's say, unusual.
For example, to read a resource, you need to call a method.
var dataset = resourceSvc.ReadResource(userId);
And this is quite understandable, but then you have to spend a lot of time trying to figure out where the label, row and column is in this DataSet. There are quite a few documentation on this issue and, to be honest, we have not found a single example of adding Timesheet Lines to the Timesheet working with this API. But, digging into the "gut" of MS Project Server using ILSPY, we finally wrote the following code:
This code, in fact, writes the necessary data in MS SharePoint. To be honest, the problems with working with MS Project were the most. About this you can write a whole separate article.
Step 3. Rollback technology on a test group of users.
We implemented a “magic button” separately for each tracker, each time covering ~ 30% of employees, and each time before a full launch, we trained on a small group of 3-5 “experimental” users, with whom we went through the whole process in a calm atmosphere before the production ready state, in order not to get a flurry of questions and indignation on Friday night from 30 people at once.
Step 4. Gather feedback
What do EastBanc Technologies employees say about the “magic button” for filling out the timesheets
Yury Bulkin, chief Java architect .
The fire!!! When I first pressed the button and immediately saw the timeframe completely filled - I just did not believe my eyes. I have been told many times that everything will happen this way. And I understood how it should look. But when I myself received the timeshit automatically filled with twenty tasks, it was so cool that I only realized the convenience of this thing.
Alexandra Ocheretinskaya, head of the project office .
We understood that the fact that we are on Friday forcing programmers to fill in time-sheets is an unprofitable, non-intellectual activity. We require you to manually enter information that already exists, just in another place and in another form. And we can save people from this unnecessary work. If people, in any case, are already working on tasks that are set up in trackers, then why not just upload this information for accounting? So we did.
Maxim Podusov, software engineer .
The process of filling in timesheets has become much faster, about 30 minutes ... It used to be 32 minutes, and now it's only 2 minutes.
Vasily Lebedev, leading software engineer .
Cool! Less duplicate work, more detailed task. You look, and the time-sheets in time will start to start. :)
Irina Manannikova, Project Manager
Specifically, in my work, I got rid of the monotonous, routine manual process of weekly testing of timesheets (labor costs). The speed of filling in timesheets is a nice bonus. And the main goal was to quickly get a transparent and clear picture of the projects in the trackers. The goal has been achieved, at the end of each week we have almost 100% relevant information on each project following the results of the last week.
Step 5. Profit!
We enjoy life and effectively use the released time.