Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Gem Version Build Status Dependency Status Code Climate Test Coverage


A very simple wrapper for the Fogbugz API. It won't give you fancy classes for everything, it'll simply aid you in sending the API requests, parsing the returned XML finally retuning you a Hash.


Add this line to your application's Gemfile:

gem 'ruby-fogbugz'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ruby-fogbugz


The Fogbugz API works by sending HTTP GET parameters to the API where the GET parameter cmd invokes a Fogbugz method, e.g. cmd=listProjects to get a list of all projects, cmds then accept further arguments, such as listing all cases assigned to a specific person:

cmd=search&ixAssignedTo=2&cols=sTitle,sStatus # list all cases associated to the user with ID of 2 in Fogbugz

In ruby-fogbugz that request would be:

fogbugz.command(:search, :ixAssignedTo => 2, :cols => "sTitle,sStatus")

Returns your parsed XML:

  "description"=>"All open cases assigned to Simon Eskildsen",
  "cases" => {
    "case"=> [
      {"ixBug"=>"143", "sTitle"=>"Write ruby-fogbugz documentation",
      "sStatus"=>"active", "operations"=>"edit,assign,resolve,email,remind"},
      {"ixBug"=>"146", "sTitle"=>"Tame a unicorn", "sStatus"=>"active",
      {"ixBug"=>"152", "sTitle"=>"Hug a walrus", "sStatus"=>"active",
    ], "count"=>"3"

As you see, ruby-fogbugz is without magic and leaves most to the user.

cmd is the first argument to Fogbugz#command, the second argument being a Hash of additional GET arguments to specify the request further. You can see available cmd's and arguments at the Fogbugz API documentation.

All Fogbugz API requests require a token. Thus #authenticate must be called on the ruby-fogbugz instance before #command's are sent:

require 'fogbugz'

fogbugz = => '', :password => 'seekrit', :uri => '') # remember to use https!
fogbugz.authenticate # token is now automatically attached to every future requests
p fogbugz.command(:listPeople)

#authenticate fetches a new token every time. To avoid the extra request, obtain a token:

require 'fogbugz'

fogbugz = => '', :password => 'seekrit', :uri => '') # remember to use https!
fogbugz.authenticate # token is now automatically attached to every future requests

puts "Token: #{fogbugz.token}"

Run the script, and initialize with the returned token:

fogbugz = => "some token to use from now on", :uri => '') # remember to use https!


This library supports multipart file uploads to include attachments in your API request. A multipart request body is created (using the multipart-post gem) if File1 is found in the command parameters. Files can be attached as follows:

fogbugz.command(:new, sProject: "SomeProject", sArea: "someArea", sTitle: "Case title", File1:, "text/plain", "someFile.rb"))


ruby-fogbugz is released under the MIT license.


Ruby wrapper for the Fogbugz API







No packages published