Improve Jira work log efficiency with this Slack Bot

Javier Hertfelder
3 min readMar 22, 2019

A couple of months ago FXStreet started to use Slack as a replace of Google Hangouts, the recommendation came from Pol our CPO.

At the beginning I was reticence about using slack as a primary communication tool but after reading a little bit about it we decided to give it a try. At that time we did not know anything about Slack bots, Slack commands or Slack API but after playing around we tried a couple of commands that were totally awesome for the team, /giphy and /todo, with only these two commands the whole team embraced Slack and forgot about hangouts forever, now we are using it to pin code, connect with VS Continuous Integration, stand-up notifications, etc..

After seeing all these capabilities we started to research about bots in slack. We read a couple of articles (this and this) and suddenly some awesome projects came into our mind.

At FXStreet we have a problem logging hours, we use Jira to manage bugs, sprints, documentation, etc and we used to have an add-on in the team board that made quite easy to log hours to certain tasks, but suddenly this add-on was no longer free. Now we need to open Jira, go to the current sprint, click in the details button, then click in log hours and then insert the number of hours to log. Nobody log hours anymore :(

So we came up with the idea to make a slack command to log hours for us, just typing /fxsbot IS-666 1h

Here you can see an overview of the architecture:

We use a .net WebApi deployed over an azure WebApps, the WebApi uses the latest Jira SDK to log the hours. For now the mapping of the users between Slack and Jira is stored statically in a Dictionary, that will be the first thing we will change.

But before starting coding we had to answer some important questions:

1.- Does exist an alternative out there to achieve this? After googling “Slack Jira Work log connector”, none of the results satisfied our needs, probably they will implement this feature soon enough but seems like it is going to be freemium, so let’s save some money for the company.

2.- Is it possible to log hours through Jira API? Jira has a well documented API, and it has a way to log hours, but to make the things easier we preferred to use a SDK, the only thing hiccup is that latest version its build under .NET framework 4.5.2 so we had some issues building the project.

3.- What parameters do we need? For now we will keep the things simple just the issue number and the number of hours, minutes, days, something like /fxsbot IS-666 30m. We will later add different commands not only for Jira so we will use /fxsbot worklog IS-666 30m.

4.- What will be the response? Something polite of course: “Thanks Javi you just logged 30m on IS-666”.

So that’s it!! it took us around 6 hours to develop, deploy and test the slack command, now let’s see if the team uses it. You can find the code in this Git repository.

Bonus Track

Gamification! Next version of /fxsbot worklog will have some gamification so we have a ranking with the number of points each member have, 1 worklog 1 point and you could check the ranking with: /fxbot logwork ranking

1/Javi 10000 pts

2/Luis 100pts…

Thanks everyone and any comment or improvement will be appreciate.

--

--