Nowadays Hackathon is a tradition that happens twice a year in MountainWarehouse when both PL and UK team up to create something useful for the company. Each of us has to propose an idea of what may be helpful, motivating and fun? The answer is Jira Fight Club! A web application that allows users in the company to get points for using Jira and to use them to fight in the real time. Boring timesheets we are coming for you!
The project goals
- Get data from Jira.
- Use SignalR.
- Think of battle process.
- Game design model.
- Have fun!
Heavy peaks to conquer
SignalR is quite new in our company and using SignalR and .net Core is totally new. SignalR is an open-source library that simplifies adding real-time web functionality to apps. Using it for creation of a chat room that might behave like a fight ring sounded fantastic. We thought it will be really easy to create hub and connected clients, but it took us above one day, so more than we expected. In the end, we decided to put server and client code in the same application so as to avoid cross-origin resource sharing (CORS) problems. We used this Microsoft SignalR tutorial to get started.
Getting points from Jira didn’t sound too simple from the beginning. We had to figure out how to get information without doing any harm to it. Surprisingly the quick answer was to use webhooks. A webhook is a user-defined callback over HTTP that notifies the application when certain events occur in Jira. (See Jira webhook documentation). However it sounds easy and setting it certainly was, but our webhook didn’t work correctly.
We chose to track events like ticket creation, status changed and ticket commented. Each action resulted in getting an assigned number of points. After a huge delay, we received some data transfer objects, which made it possible to work on it and move forward. One more day and I assume we would be able to solve the issue. Our work was parallel with a Jira version update that could have caused some problems (and also another hack team accidentally performing DoS attacks on the server – Ed.).
Figuring out the battle process was a lot of fun. It took much time but was worth it. I cannot say it was easy, but each of us adds some parts to it with a pleasure. Everyone was so excited about the project that we spent some of our free time to work on it. We ended with characters that have strength, dexterity, experience, and vitality. We did not forget about adding some luck represented by dice roll. We also didn’t want employees to play all day long, so we added a few rechargeable action points that might be used to fight someone.
A good game should also have an attractive appearance and we achieved it by personalized characters.
Checking these complex battle algorithms required some testing. We added the xUnit project to our solution. After running a few first tests some of our characters fall on minus levels, which was definitely not intended behavior. Tests allowed us to quickly find and remove bugs from our code.
The highest peak
The fruit of our labor is an application that collects users and active points based on Jira activity. Each user can distribute his points to his abilities and then may fight opponents. We can see the course of the battle and we are climbing the levels. If you want to be the best in the Fight Club you have to be Jira master. I hope it seems motivating.
What would I do differently if we tried that project again? I am so satisfied with the results that the answer is nothing. It might be tempting to use standard .net and make everything on time, but we have learned so much that it would have been a waste not to use this opportunity to learn as much as we could have.