Fixing Numara Footprint’s addressbook search with a Greasemonkey Userscript

UVM uses Numara Footprints to track client support tickets. When creating tickets from client submitted email, the application automatically fills out the contact information for the client, using their email to search against LDAP.

This search fails if the address from the incoming ticket is in the format (as opposed to This results in a significant number of tickets coming into the system with only an email address in the contact field.

It seems the only way to fix this is by copying the uid, clearing out the rest of the fields, and searching by uid again. This needs to be done for every affected ticket.

Firebugs, Greasemonkies, and Mr. DOM

Lately I’ve found myself spending too much time copying and pasting fields in footprints. So the other day I took a quick spin through the ticket editing interface with my trusty Firebug. Minutes later I was able to replicate the functionality needed to fix the problem, using Javascript and the supplied DOM elements.

The next logical step was to encapsulate this into something that can be used outside of the development interface, and triggered automatically.

Enter the Greasemonkey. Greasemonkey is an extension for Mozilla Firefox that allows you to run custom scripts on pages that you are visiting. Think of Greasemonkey as a little mechanic that lives in your browser. It has a bunch of tools that it uses to alter or fix pages that you visit. These tools are known as Userscripts.

Turns out it’s pretty easy to write these Userscripts. Based on my spelunking in the DOM cave with Firebug, I slapped together a Userscript to fix my address book problem upon opening the ticket. Now when I load up the ticket editing interface, the contact information is automatically filled out — even if the ticket was created with an inconveniently formatted email address.

Lazyweb to the rescue

I was in a hurry, and didn’t feel like digging through my old code or writing new stuff to handle some of the grunt work that this tool needed. I borrowed a handy email address parser from Ben Nadel at Kinky Solutions, and a url parameter grabbing function from Netlobo.

Installation and use

  1. You’ll first need the Greasemonkey extension for Firefox. If you need this (or Userscripts in general) in Safari, I’d recommend taking a look at SIMBL and Greasekit.
  2. Install the Userscript.