Archive for 16 July 2008

ruby/trac: create a new ticket from an email

A little ruby script to create a new ticket in trac from an email message.

Needs rubygems, hpricot, mechanize and tmail.

  1. Edit the header of the script and change user, password, etc.
  2. Save the email as a text file (usually right click -> save as.. in your mail client).
  3. Run “email2ticket emailmsg.txt” where emailmsg.txt is the email you just saved.

The subject of the new ticket will be the subject from the message and the description of the ticket will be the body from the message.

The script asumes you are using http authentication with your trac.

Tested with trac 0.11

The script here.