JIRARuby: A Ruby Gem for automating JIRA from Ruby
JiraRuby is a Ruby library by Jason van Zyl that uses Soap to automate JIRA. I used this to create a bulk bug creation tool that combines information from a spreadsheet with common settings specified in a file or on the command line.
I’ve noted in the past the difficulty I had creating a SOAP driver for Ruby due to bugs in various versions of the stub generation tool; if you use the version included with JIRARuby you can spare yourself these difficulties.
JiraRuby also implements a few additional methods not available via the SOAP interface via HTTP Posts.
For whatever reason, I couldn’t get the gem to install directly so I simply downloaded the files from the CVS repository.
One especially tricky point about automating JIRA, which is not well documented in the SOAP interface, is how to set custom properties. I document this here to spare you my pain.
- You must initialize a RemoteCustomFieldValue with a name field such as “customfield_10040″, where 10040 is a value that can only be determined by looking at some query string parameters in JIRA.
- The value of the custom field is an array including literal text that you want to set, rather than an ID. This is different from built in properties like status, which use a numeric index rather than the text.
Here’s an example.
issue = RemoteIssue.new()
# ...code omitted to set standard properties...
# set custom properties
bucket = RemoteCustomFieldValue.new("customfield_10040", nil, ["Search"])
issue.customFieldValues = [bucket]
# create the issue
issue = jira.createIssue(token, issue)
2 Comments so far
Leave a comment
Hi, I’m trying to follow you tips to execute an issue update on a customfield (it’s ok with creation)..
I wasn’t able do do this.. have you ever a tip fo updating?
Thanks
Paolo
By paolo freuli on 03.19.07 9:30 am
Hi! I need to automate test process of JIRA installed for my company. Please can you provide more detailed info and examples of this gem usage. Or please post some useful links.
Thank’s, Philip
By Philip on 07.16.07 3:27 pm
Leave a comment