This article is an extension to the previous one: Automating Jira Analytics with Apache NiFi . Now I would like to expand on our view of reporting on Jira Software and the experience of its implementation using R. The language here, of course, is not a dogma. Today our everything is a concept. The picture is borrowed here .
Let's imagine a task tracker. What data can I, as an analyst, extract from it? Or any off-the-shelf analytics platform? The number of tasks for the period, logging statistics, basic breakdown into projects, some pictures about the productivity of employees ... and that's all, offhand.
But everything that is done is put into fat. Therefore, you can probably single out something more global: what the team is doing and in what direction it is moving.
Yes, we did it. However, it was not without PM's help first.
Reorganization of the task tracker
Of course, each specific Jira is significantly different from any other. And our solution may not be the most effective for you, or even applicable at all.
I ask you to regard this only as an idea of organizing a task-tracker, using the example of our outsourcing company.
We made only two moves.
First and simplest. They accepted that all tasks within one direction should be tied to the epic , of course . Epics are the largest objects in Jira, representing multiple issues. They help build hierarchy and structure, and can also span multiple sprints and versions.
A little more about the second. We will be able to see the big picture and answer strategic questions ifthe workflow will be presented as a kind of flow, to which each employee contributes . For this, in our case, the IT4IT concept is ideally suited, with its operating model based on a four-stream value chain: Actually, what have we done. Taking advantage of IT4IT, we added such a thing as a task component to Jira. We have the following:
- Service to Portfolio (Demand and Selection) - the stage of "cutting", search, choice of service, technology.
- Request to Deploy (Plan and Design) - discussion, planning of development, development of services, services.
- Request to Deploy (Develop) - development of a service, a service of something.
- Request to Deploy (Deploy) - deployment of something.
- Request to Deploy (Test) - testing a service, service.
- Request to Fulfill - the stage of operating the developed services, providing services.
- Detect to Correct (Correct) - fix, revision of internal services and services.
- Detect to Correct (Monitor & Feedback) - the same thing, only + communication with the client.
At this stage, perhaps the most difficult thing is to convince employees that an extra item in the tracker is not for nothing and that it must be filled out correctly.
Data analytics in R
Now there should be no obstacles to the implementation of reporting. I will formulate the similarity of TK.
Since at the beginning of each week the team meets for the mit for planning, the report should be weekly. It is important for us to see statistics on the appearance and progress of tasks, logging of employees and the contribution of each of them to the overall picture. Answer the question: what is the team doing - in terms of epics and components.
Knowing what we need to get, we go to unload the data. Through the Jira API, we request all the issues (issues) that were updated last week. We extract keys from them and load the logging history (worklog) and the history of changes (changelog) for each task. Perversions with overloading are necessary to get around the apish restrictions.
Next, the area of responsibility R begins, since the preprocessing of the received data is a component of the report generation script.
There is nothing clever in it, you just need to parse the JSONs that came from the api and leave only the necessary properties (items in Jira). The only moment, when processing the changelog, we are only interested in the task status changes, the rest can be safely deleted.
And finally, we got to the analytics.
We find out how many tasks were opened, were in work, closed and postponed over the past week. Take a look at the R code:
#
this_week_opened <- jira_changelog_data %>%
filter(issue_type != "Epic") %>%
filter(as.Date(issue_created) >= start_date) %>%
filter(as.Date(issue_created) <= end_date) %>%
select(key, issue_created) %>% unique() %>% nrow()
#
this_week_processed <- jira_worklog_data %>%
filter(as.Date(started) >= start_date) %>%
filter(as.Date(started) <= end_date) %>%
select(key) %>% unique() %>% nrow()
#
this_week_closed <- jira_changelog_data %>%
filter(issue_type != "Epic") %>%
filter(as.Date(issue_resolutiondate) >= start_date) %>%
filter(as.Date(issue_resolutiondate) <= end_date) %>%
select(key, issue_created) %>% unique() %>% nrow()
# /
this_week_holded <- issue_history %>%
filter(change_date >= start_date) %>%
filter(change_date <= end_date) %>%
filter(toString == "Hold" | toString == "Backlog") %>%
select(key) %>% unique() %>% nrow()
Does this remind you of pseudocode? And if I say that the operator ' %>% ' transfers data from the previous function to the next. And the last modification in the entire chain will be saved to a variable. Imagine, we just climbed to the threshold of entry into R!
Have you fallen in love with him yet? Then, if you will, I will add some more information.
Words from Wikipedia:
In general, as a programming language, R is quite simple and even primitive. Its greatest strength is its unlimited expansion with packages.
The basic R delivery includes a core set of packages, and in total, as of 2019, more than 15,316 packages are available.
And the last thing for today. This year R broke into the top ten most popular languages in the world ( proof ). I'm proud of him.
Please forgive me for this retreat. I can talk about R for hours. It's just that he's completely shrouded in myths, and I like to destroy them - a hobby, you know.
Let's go back to the report. Having the required numbers, we visualize them. After that, we arrange the logging of employees. This is how this part looks with us: I will continue to show you the final images from the same real report. Our line of business is reflected in the following graph. It also allows you to assess the workload of employees with operational activities. And here is a breakdown of all tasks by component. He gives the answer to the question of what we are doing. I supplement the picture with figures.
Well, the promised contribution of each employee to the big picture given above.
I'm sure you will immediately notice where our developer is, and where is the admin. We were striving for this clarity. The real report is also supplemented with a summary of the movement of tasks. This is an addition to the general statistics posted at the very beginning, with the names of the tasks and the names of the responsible people.
Generating a report
To set up automatic report generation, for example, on Mondays from an R script, you can use the cronR package , it's extremely simple.
With us, everything is more complicated and elegant. We used Apache NiFi to download data from the Jira API on a weekly basis, run the report generation script and send a report to all employees by Email . This topic is so extensive that it deserves a separate article .
Conclusion
The number of Jira Software implementations, as well as the number of companies where it is used, is a lot. At the same time, each boss needs his own unique metrics base for tactically correct management. Yes, there are eazyBI and other analytics plugins for Jira, but the result is like buying a suit in the store instead of a custom Bespoke.
The considered report is sewn according to templates. According to the boss, it provides a strategic view of what the unit or team is doing . I hope this article will help you implement something similar at home.
Thanks.