Or you can browse.

Dugan's Blog

Post details: JIRAnemo!

October 3, 2006
Posted by dugan
11:43 AM
JIRAnemo!

(That's pronounced like geronimo.)

I've been playing with a way to ensure that the JIRA tickets that get made for rMake have the correct information associated with them. To that end, I developed a python SOAP client for JIRA, called pyjira. I also created a front end, called jiranemo (good for plunging into the dark and murky seas of bug finding). They're still very much alpha, and JIRA's api has some holes as well*, so don't expect miracles. I have been able to create, display, and search for issues, and add comments with it however. I have an API for adding attachments but haven't exposed it through JIRAnemo yet though.

Another thing this will let us do, I am hoping, is automatically add information to JIRA when a fix is committed that links to the hg repository. That way we can track more easily what code was committed to fix a bug. That will let people who are interested in the patch(es) related to that bug find the relevant fix. A hook like that for cvc would be nice as well!

To install jiranemo type:
conary update jiranemo --install-label contrib.rpath.org@rpl:devel --resolve

To use JIRAnemo with rPath, you have to go through some extra hoops, because our JIRA instance setup is a little non-standard.

To use jiranemo with the rPath JIRA, set up a .jirarc in your home directory with the following entries:
wsdl http://people.rpath.com/~dbc/rpath.wsdl
user youruser
password yourpassword

Then you can run commands like jiranemo list issue CNY-200, jiranemo list projects, and so on.

In general, the wsdl you'll use for more standard setups looks like
http://[project]/rpc/soap/jirasoapservice-v2?wsdl, but that one won't work for rPath.

* For example, if you submit a comment with a security level that doesn't exist, it fails silently. Also, as far as I can tell there's no way to determine what valid security levels are. Also the search by filter api seems to always return empty results. Exceptions returned from JIRA are often cryptic if the parameters are wrong.

Comments:

Comment from: Matt Doar [Visitor] · http://www.pobox.com/~doar
10/03/06 @ 12:46
Nice one! I've been doing similar stuff for XenSource (we also use hg and Jira). I wrote an hg plugin modeled on the svn plugin that scans repository commit messages for Jira bug ids. Works well, and it doesn't matter if Jira is offline when you make the hg commit.

I also wrote a Python Jira CLI (but my name for it isn't as witty as yours :-) to help reduce time spent waiting for Jira pages to refresh etc. I agree that the Jira API has some surprising holes in it. I wish they had more bandwidth to incorporate and support methods added by their users.

~Matt
mdoar@pobox.com
[mdoar@matt-linux trunk cli]$ ./jira

./jira [options]

where is one of:

attach Attach a file to an issue
cat Show all the fields in an issue
catall Show all the fields and comments in an issue
close Move an issue to the Closed state
comment Add a comment to an issue
comments Show all the comments about an issue
create Create an issue
dev Template for testing API commands
resolve Move an issue to the Resolved state
help Get a summary of commands, -v shows all details
history Show the history of an issue
log Log work on an issue
login Login to Jira
logout Log out of Jira before the session is timed out
projects Show all the projects in Jira
reopen Move an issue to the Reopened state
report Run a report already defined in Jira
reports List all the available reports
runservice Run a Jira service
services Show all services available in Jira
test Run unit tests on the Jira CLI
update Update the contents of an issue

"./jira --help" provides more usage information


Comment from: Matt Doar [Visitor] · http://www.pobox.com/~doar
10/03/06 @ 12:47
Another thought: you can avoid storing people's passwords if you just cache the auth token that Jira returns in a file.
Comment from: dugan [Member]
10/03/06 @ 13:14
Those both sound great! I don't suppose those tools are published anywhere?
Comment from: Matt Doar [Visitor] · http://www.pobox.com/~doar
10/03/06 @ 17:35
That very topic is being discussed here now :-)

~Matt
Comment from: dugan [Member]
10/04/06 @ 11:15
For those following: I took the advice re caching the auth token, and added attach and filter commands.
Comment from: Matt Doar [Visitor]
10/06/06 @ 20:38
Take a look at the attachment at:
http://confluence.atlassian.com/display/JIRAEXT/Jira+CLI
Comment from: Matt Doar [Visitor]
10/06/06 @ 20:54
The mercurial plugin is attached at:
http://confluence.atlassian.com/display/JIRAEXT/Mercurial+Plugin

Comments are closed for this post.