PowerShell scripts are widely used by small or large enterprises. This scripting language has been provided by Microsoft and by using it IT professionals are empowered to securely manage various Windows functions and operations through easy-to-use command-line shell. If we can enumerate all the features that are supported to be accessed and managed by PowerShell that would be a really long list. But, if we need to point out some, these would be the most interesting: access to full COM and WMI locally or remotely, full access to .NET classes, Access to APIs, access to central repository for thousands PowerShell modules, management for all Microsoft tools since 2012 like SQL server, Exchange, SharePoint etc.
InterWorks is partner both to Microsoft and Atlassian. We are widely using Atlassian Jira, and part of our success is shown by reports generated by Jira. A Jira feature that we often use is “Log Work” option. That gives our team the opportunity to log their actual work effort directly in the tracking system, on one location, on an actual story they were working on, without using different web solutions. Although there are some – more or less- pricey Jira plugins that can give us all in one report for the time spent on a story by the developers, we like to have the freedom to generate our own reports and show them in a suitable structure. That’s where the power of Microsoft PowerShell comes along. Using the JiraPS, Windows PowerShell module that eases the interaction with Atlassian JIRA via a REST API, we are able to build our own queries to select, group, filter or sum the selected data, and then to export it in the desired format. And that’s not all. We can automate the process with creation of stories, changing their status, and all the interactions that are available through the web interface.
This is one of our scripts that we created. The challenge we had was creating a custom report that can sum the logged work from multiple sub-tasks into their parent story, and to export it grouped by date and worklog author in a specified time range.
Executing the script is pretty easy. We can provide the names of the team members we want to include in the report, the name of the server, the name of the project, start date and the number of days after the start date.
And voilà! As simple as that with a little bit excel styling, we can get a perfect report for our needs.