Categories
Program Management

Transforming data outside of JIRA

JIRA is largely used (Atlassian suite is adopted by 170k+ customers over 190 countries) and one of the reasons for that is that its platform allows for deploying new add-ons to expand its capabilities. You can find a plethora of plugins in Atlassian Marketplace, but purchasing all plugins you need can quickly add up if you have a large user base. Sometimes all you need is to transform data for reports or metrics, even if that’s done outside of JIRA in an Excel spreadsheet or command-line console. In this article, I cover two ways to extract data from JIRA and transform it while minimizing manual work: Excel Datasources and Python API calls.

Excel Datasources

JIRA allows you to export filter results in CSV. One could generate a CSV from JIRA, copy its data, and then transform the data in Excel to create custom charts or consolidated reports. While that works, if you need to do that multiple times, you’ll be wasting a lot of time with manual work. We can leverage the same CSV feature in combination with Excel import data feature to get the work done faster. The steps are pretty straightforward:

  1. Create and save a filter in JIRA
  2. In the filter result page, go to Export >> CSV (Current fields), right-click on it and copy link address
    1. It should be something like https://yourjira/sr/jira.issueviews:searchrequest-csv-current-fields/19974/SearchRequest-19974.csv where 19974 is the JIRA filter ID
  3. Open Excel and go to Data >> From Text/CSV
  1. Paste the JIRA deep-link to export the filter as CSV
  2. Excel will connect to JIRA and you’ll be asked to select the authentication method if that’s the first time you’re doing it
  3. Select Basic and type your JIRA credentials. Important: Authentication methods may vary depending on how your JIRA instance is set up and your credentials will not be shared if you send that spreadsheet to other people
  4. Excel will show you a preview of the retrieved data. You can click on 1) Load to create a new worksheet and load the data, 2) Load To… and customize where to load the data to, or 3) Transform Data to adjust which columns you want to import
  5. Once the data is loaded, you can go to Data >> Queries & Connections and click on the refresh icon to reload the query
  1. Now you can create a separate worksheet and create your custom reports or aggregations based on the raw data imported from JIRA. That’s it. Quick and dirty, right?

Python API calls

If you need to apply more complex logic to your data, an alternative way is to call JIRA APIs utilizing a programming language to parse and transform it. I’m showing a very basic Python example of how to calculate the % of closed Story Points in a filter, but you could apply a similar process using whichever language you prefer for more complex calculations.

Firstly, you need to understand how to authenticate to be able to call JIRA APIs. You can use either OAuth, Basic, or Cookie-based methods. I’m only covering the Basic one in this article, which should be used only for personal scripts. OAuth is the most secure and recommended method but it will require additional configuration in JIRA server to authorize your script to call the APIs. You can read more about the other methods here.

Prep work

  1. Make sure you have Python 3.5+ installed in your system
  2. Install jira module with pip install jira

Python Code

See below the Python code. You can also access it from github.

from jira import JIRA
import getpass

# add your JIRA instance URL here
jiraURL = 'https://myjira.com'

# update with JIRA username or replace it with
# username = input('Type your JIRA username')
# to ask for the username in the command line
username = 'myusername'

try:
    password = getpass.getpass(prompt='Type your JIRA password: ')
except Exception as error:
    print('Error when getting password', error)
else:
    jira = JIRA(jiraURL, basic_auth=(username, password))
    try:
        filterId = '27629'
        filterJQL = jira.filter(filterId).jql
    except Exception as error:
        print('JIRA filter ' + filterId + 'is not available or does not exist')
    else:
        issues = jira.search_issues(filterJQL)        
        totalPoints = closedPoints = 0
    
        for i in range(len(issues)):
            fields = issues[i].fields
            points = 0 if fields.customfield_10002 == None else fields.customfield_10002
                  
            totalPoints += points
            closedPoints += 0 if fields.status.name != 'Closed' else points
            
        percentage = 0 if (totalPoints == 0) else (closedPoints / totalPoints) * 100
        
        print('Total points: ', totalPoints)
        print('Closed points: ', closedPoints)
        print('Closed %: ', round(percentage, 2))

This code connects to the JIRA instance (line 5) using the username (line 10) and the password read via command line (line 13). It retrieves the JQL string (line 20) for the filter which id is 27629 (line 19). Then it retrieves the list of issues for that filter (line 24), iterates through it (line 27), and calculates the total story points (line 31) and closed story points (line 32) assuming that the Story Points value is saved in the customfield_10002 property (line 29). The custom field for Story Points in your JIRA server may differ but you can easily get its ID doing a JIRA query and looking at the autocomplete results. It will show something like the following:

Finally, you just need to run the python script in a command line (like py.exe .\closedPointsJIRA.py) and type your password when asked. Handy, right?

Categories
Program Management

5 traps that technical managers can fall into

Nothing in life is always a bed of roses and even seasoned technical managers make basic mistakes that impact their teams’ performance. In my previous articles (If you’re a manager, invest more time in your tech skills and For Managers: How to develop your tech skills) I covered the importance of that set of skills and how managers can develop them to help on their day-to-day work. Let’s now talk about the common pitfalls that I’ve seen experienced managers face mostly because they have (or believe they have) a solid technical background. I have to be honest and confess that I’ve caught myself making these mistakes on several occasions.

#1: Fire-fighter mode is ON

Quite often team members reach out to managers to discuss a problem, but they are not actually looking for a solution. All they want is to vent, bring awareness or have a fresh pair of eyes looking into it.

However, it’s tempting for managers – whose common traits include assertiveness and decisiveness – to think they are expected to provide solutions. If the problem is related to an area where the manager has worked in the past, it’s almost certain that a ‘suggestion’ will come up, either due to an unconscious need to show that he/she is still sharp or due to a genuine willingness to help.

The problem with this fire-fighter approach of jumping in and trying to fix the problem is that it can easily kill team ownership and empowerment if not applied in small doses. Coaching techniques [1] could be helpful to suppress that impulse to always address the problem.

#2: Directions instead of suggestions

As a manager, you need to recognize that no matter how flat, small or open your organization/team is, you’ll have power over your subordinates and they will not see you as a peer. That doesn’t mean you can’t have a fruitful and open relationship with your team members.

Once you provide technical suggestions – even in areas where you are the most experienced in the room – the team will receive them differently if they were hearing them from a peer. Some teams may be more vocal and push back if they disagree with the proposals. Other ones may feel compelled to accept them since they came from their manager.

In those cases, the best way to avoid problems is to assess and build a safe environment where people can share their thoughts. Do a quick test: measure the team participation in Sprint Retros with and without their managers in the room. If the team doesn’t feel comfortable to share certain problems because the manager is present, that’s usually a sign that there is some work to be done to make that environment more psychologically safe.

#3: Tech skills to be able to speak up

Managers can leverage their technical skills to better understand what the team is trying to communicate. Active listening [2][3] is one of the major virtues of an outstanding leader and should be practiced during technical sessions too. However, one may think that the main benefit of having those skills is to able to speak up and contribute to solutions.

As a manager, you should try to hold your natural instinct of speaking more than listening and allow the team to brainstorm before you interject them with your thoughts.

#4: Misinterpreting the level of engagement

If a manager is lucky, he/she will spend 4hs/week developing their technical capabilities. During the same period, a developer will spend at least 10x more time (40+ hours). How can a manager keep up with the technical changes in a project? He/she just can’t and, for everybody’s sanity, that’s intentional and expected.

Therefore, a manager needs to be mindful that his/her solution knowledge is at the same time outdated and at a high level. That should dictate how much technical engagement he/she could have and how his/her comments should be positioned to the team.

#5: Tech skills take precedence to interpersonal skills

Nobody will hire a manager because he/she is an outstanding Java developer or an experienced Senior Architect. One is promoted to a management position due to his/her abilities (or potential) to lead other people to get work done through them.

Technical skills can be your competitive advantage, but you should never lose sight that your job requires developing mainly other areas such as leadership, coaching, people development, and project management. Avoid spending too much time developing technical expertise, even if that seems to be more enjoyable.

Categories
Program Management

For Managers: How to develop your tech skills

In a previous post, I’ve covered the importance of investing time to keep your tech skills up-to-date. In this post, I’d like to share a few ways to achieve that. I’ve tried a few of them in the past and they’ve worked for me. A few other ones seem interesting and worthwhile to give them a chance. I’ve taken into account the time constraints for managers when curating the following list.

Hackathons

More and more companies have been using hackathons as tools to drive innovation, build teamwork, and improve internal processes. Even though the target audience is usually the Software development team, managers should leverage those opportunities to get their hands dirty and brush up those coding skills. Since those events usually last only a few days, managers have a better chance to be able to put aside some of their day-to-day tasks to focus on those hackathons.

Lunch & Learn

Knowledge sharing is continuously happening among the team members, but managers quite often are not involved in those discussions. Lunch & Learn sessions are effective methods to share knowledge across different functional areas. If you’re a manager and that’s not a common practice in your company, that’s an opportunity for you to develop your team and, as a side-effect, to get to know what the team has been working on from a technical perspective.

Meetups

Meetup.com provides an amazing and free platform to know what’s going on in your area. Since I moved to the US in 2014, I’ve been a big fan of Meetups, but I have been participating only in project management or Agile groups. Recently I’ve given a chance to DevOps meetups and they turned out to be quite handy. In addition, those Meetups can be a useful channel to share open positions, if you’re hiring people.

Local Conferences

As a manager, you may be challenged to justify why you should attend a development/DevOps/… conference that can easily costs $2-3k when including registration, flights, and hotel. In addition, if you need to travel, the amount of out-of-office time can impact your other management tasks.

As an alternative, if you find a local conference that costs only a few hundred dollars, you have a better chance to convince your organization that a couple of days per year are worthwhile and will not impact much your other duties.

Online courses

E-learning platforms like Coursera or Udemy are the go-to options for many people since they can pace their courses as they prefer. However, online course incompletion rates can be as high as 85+%. I’d recommend not to enroll in more than one course at a time to improve your chance to actually complete them.

Certifications

My opinion about certifications may seem a bit contradictory. Even though I have several certifications, I really don’t care about the actual certifications. The most important outcome of any certification is learning during the process. A certification is just a clear finish line that helps me to get organized and commit to studying. Even better if the certification exam voucher has an expiration date. 🙂

If you take major cloud providers as examples, they provide entry-level certifications (foundational or associate) that cover enough technical fundaments for a manager. Google Cloud Associate certifications are recommended for people with 6+ months of experience, while AWS certifications have foundational (~6 months of experience) and associate (~1 year of experience) paths.

Personal projects

Another approach that requires more discipline but that’s very effective is to define a personal project and implement it. It could be as simple as a to-do mobile app for you and your spouse to share chores. Addressing a personal problem can be the extra motivation you need to get that going.

As a piece of advice based on previous failed attempts to do this, keep that as simple as possible and work on incremental releases. If you can’t complete that within a week, reduce the scope until it fits in that timespan.

Contribute to existing projects

You can easily find an open-source project that’s interesting, but the most interesting ones are also likely to require a massive ramp-up time even for small contributions (bug fixes, test automation, …). If that’s a path you want to take, shoot for tiny GitHub projects (less than 2k lines of code), look at their backlogs of known issues, fork it and try to get a few bugs fixed. Here’s another neat idea to get started.

Another way is to find new projects looking for collaborators. A convenient platform for that purpose is FindCollabs. You could even bring that platform to your company as the official way to engage people interested in working on side projects.

Final tips

With such a breadth of options to develop your tech skills, the most important thing to keep in mind is that you need to be laser-focused on what you want and avoid biting off more than you can chew. Enjoy your journey and, most importantly, have fun while learning.