|
|||||
|
|||||
Jira Report
OverviewThe swizzle jira report tool is easy to run. Just download swizzle-jirareport-1.2.1-dep.jar and run it from the command line:
See the Jira Report Reference page for a terse set of non-tutorial style documentation. Basic template using RSS dataThis is about as simple as it gets. You can take any RSS feed from jira and report that data to your liking. There are a couple ways to get RSS URLs from Jira:
You can take a template like this one, replace the RSS URL and you're off and running. jirarss.vm #set( $jira = $rss.fetch("http://jira.codehaus.org/browse/SWIZZLE-1?decorator=none&view=rss") ) #set( $issue = $jira.getIssue("SWIZZLE-1") ) [$issue.key] $issue.summary - project: $issue.project - id: $issue.id - type: $issue.type - priority: $issue.priority - affectsVersions: $issue.affectsVersions - fixVersions: $issue.fixVersions - components: $issue.components - status: $issue.status - resolution: $issue.resolution - created: $issue.created - updated: $issue.updated - duedate: $issue.duedate - reporter: $issue.reporter - assignee: $issue.assignee - votes: $issue.votes - environment: $issue.environment - description: $issue.description - $issue.link
[SWIZZLE-1] Unit Test Summary
- project: SWIZZLE
- id: 40099
- type: New Feature
- priority: Blocker
- affectsVersions: []
- fixVersions: [Test Version]
- components: [jira client]
- status: Closed
- resolution: Fixed
- created: Fri Aug 04 18:05:13 PDT 2006
- updated: Fri Aug 04 19:33:48 PDT 2006
- duedate: Sat Aug 05 22:00:00 PDT 2006
- reporter: David Blevins
- assignee: David Blevins
- votes: 1
- environment: Unit Test Environment
- description: Unit Test Description
- http://jira.codehaus.org/browse/SWIZZLE-1
Basic template using XML-RPCSame template as the above with the exception this one gets the data via XML-RPC. Notice, we need to specify a username and password to connect to the JIRA server. That's kind of a bummer, but the advantage of using XML-RPC is that you can get more data about the issues, versions, components, users and the other projects in the server. One big thing you can't get via RSS is the "Affects Version/s" for an issue. Don't ask me why but they left that out, so if you need that info you'll have to use XML-RPC. There is a way to mix RSS and XML-RPC and it's not too hard, take a look at the "fill" method on the Jira class if you need such a feature. jiraxmlrpc.vm #set( $jira = $xmlrpc.connect("swizzletester:swizzle","http://jira.codehaus.org/rpc/xmlrpc") ) #set( $issue = $jira.getIssue("SWIZZLE-1") ) [$issue.key] $issue.summary - project: $issue.project - id: $issue.id - type: $issue.type - priority: $issue.priority - affectsVersions: $issue.affectsVersions - fixVersions: $issue.fixVersions - components: $issue.components - status: $issue.status - resolution: $issue.resolution - created: $issue.created - updated: $issue.updated - duedate: $issue.duedate - reporter: $issue.reporter - assignee: $issue.assignee - votes: $issue.votes - environment: $issue.environment - description: $issue.description
[SWIZZLE-1] Unit Test Summary
- project: SWIZZLE
- id: 40099
- type: New Feature
- priority: Blocker
- affectsVersions: [Test Version]
- fixVersions: [Test Version]
- components: [jira client]
- status: Closed
- resolution: Fixed
- created: Fri Aug 04 20:05:13 PDT 2006
- updated: Fri Aug 04 21:33:48 PDT 2006
- duedate: Sun Aug 06 00:00:00 PDT 2006
- reporter: David Blevins
- assignee: David Blevins
- votes: 1
- environment: Unit Test Environment
- description: Unit Test Description
SortingThat gets us through the basics. Now the fun stuff. Probably right away you are going to want to sort your issues to your liking. You can do that very easily. Every list of objects we return has some nifty methods that you can use to return a sorted version of that list. The following methods are available:
Where list is the collection you wish to sort and fieldName is the "attribute" you wish to sort by. These can even be chained for primary, secondary, etc. sorting. Here are a couple short examples before we show the complete example.
votes.vm #set( $jira = $rss.fetch("http://jira.codehaus.org/secure/IssueNavigator.jspa?view=rss&&pid=11230&component=12371&tempMax=25&reset=true&decorator=none") ) #set( $issues = $jira.issues ) Issue sorted by votes #foreach ( $issue in $issues.descending("votes") ) $issue.votes votes -- $issue.summary ($issue.key) #end
Issue sorted by votes 3 votes -- Fix the toilet (SWIZZLE-6) 2 votes -- Beer fridge for the garage (SWIZZLE-10) 1 votes -- Put a TV in the bathroom (SWIZZLE-7) 0 votes -- Clean the pool (SWIZZLE-9) 0 votes -- Make sure the smoke alarms work (SWIZZLE-11) 0 votes -- Get more colored lights for the disco ball (SWIZZLE-8) 0 votes -- Fix whole in the wall (SWIZZLE-12) FilteringThe next basic need is to not want all the issues, but to somehow filter them down to a smaller set. That's easy enough too. There are a few different methods for that. These all create and return new, filtered, lists:
by-type.vm #set( $jira = $rss.fetch("http://jira.codehaus.org/secure/IssueNavigator.jspa?view=rss&&pid=11230&component=12371&tempMax=25&reset=true&decorator=none") ) #set( $issues = $jira.issues ) New Features: #foreach ( $issue in $issues.equals("type", "New Feature") ) * [$issue.key] $issue.summary #end Improvements: #foreach ( $issue in $issues.equals("type", "Improvement") ) * [$issue.key] $issue.summary #end Bugs: #foreach ( $issue in $issues.equals("type", "Bug") ) * [$issue.key] $issue.summary #end Tasks: #foreach ( $issue in $issues.equals("type", "Task") ) * [$issue.key] $issue.summary #end
New Features: * [SWIZZLE-10] Beer fridge for the garage Improvements: * [SWIZZLE-8] Get more colored lights for the disco ball Bugs: * [SWIZZLE-6] Fix the toilet * [SWIZZLE-12] Fix whole in the wall Tasks: * [SWIZZLE-9] Clean the pool Sum and AverageThere aren't a lot of data types in the Jira object model that are truly numerical, but for those that are there are a couple list methods at your disposal. These both return an int rather than a list like the above Filters.
Issue Subtaskssubtasks.vm #set( $jira = $rss.fetch("http://jira.codehaus.org/browse/SWIZZLE-2?decorator=none&view=rss") )
#set( $issues = $jira.fillSubTasks() )
Issues with Sub-tasks
#foreach( $issue in $issues )
[$issue.key] $issue.summary
#foreach( $subtask in $issue.subTasks )
- $subtask.key: $subtask.summary
#end
#end
Issues with Sub-tasks [SWIZZLE-2] Need Wilhemina to get some things from the store - SWIZZLE-3: a loaf of bread - SWIZZLE-4: a container of milk - SWIZZLE-5: a stick of butter Dynamic Attributesattributes.vm #set( $jira = $xmlrpc.connect("swizzletester:swizzle","http://jira.codehaus.org/rpc/xmlrpc") ) #set( $issues = $jira.getIssuesFromFilter("swizzle test issues") ) Issues by Score (votes x affect versions) #foreach ( $issue in $issues ) #set( $issue.attributes.score = ($issue.votes 1) * ($issue.affectsVersions.size() 1) ) #end #foreach ( $issue in $issues.descending("@score" ) ) $issue.attributes.score -- $issue.summary ($issue.key) #end
Issues by Score (votes x affect versions) 9 -- Beer fridge for the garage (SWIZZLE-10) 8 -- Put a TV in the bathroom (SWIZZLE-7) 8 -- Fix the toilet (SWIZZLE-6) 4 -- Make sure the smoke alarms work (SWIZZLE-11) 2 -- Fix whole in the wall (SWIZZLE-12) 2 -- Get more colored lights for the disco ball (SWIZZLE-8) 1 -- Clean the pool (SWIZZLE-9) |
|||||
|
Copyright 2003-2006 - The Codehaus. All rights reserved unless otherwise noted.
Powered by Atlassian Confluence
|
|||||