This article uses Project Open 3.5.0.0.1 for the example code. The technique described here has also been tested against 3.4.x.
If you’re using Project Open, you know that it includes a great Help Desk package called intranet-helpdesk. And if you’re like me, you diligently tested all of the functionality and came away pleased that it was so robust.
Until, that is, you (or worse — your users) get an error message like this:
Unable to create ticket:
Ticket Name 'My Computer is Broken' already exists.
The message is telling me that someone already entered a ticket whose Name was “My Computer is Broken.”
Project Open’s intranet-helpdesk won’t allow duplicate ticket names.
Imagine you’re trying to deploy Project Open to hundreds of people. Now, imagine telling those same people that they can never, ever enter the same Help Desk ticket name. When they ask, “Well, how will I know?”, you’ll have to tell them something like, “Uh, you’ll have to search the names of all open and closed tickets. But I’ll be happy to train you on the search engine!”
They’re probably point and stare. At the very least, they’re whisper behind your back.
That’s not a compelling vision, is it? Not a ringing endorsement of open source software. And it’s certainly not a career-enhancing move.
Fortunately, this is easily repaired by editing new.tcl in the intranet-helpdesk package. The full path to the file is (in my Linux installation):
/web/projop/packages/intranet-helpdesk/www/new.tcl
Locate the code that looks like this:
} -new_data {
set message ""
if {[info exists ticket_note]} { append message $ticket_note }
if {[info exists ticket_description]} { append message $ticket_description }
if {![exists_and_not_null project_name]} { set project_name $ticket_name}
set ticket_id [im_ticket::new \
-ticket_sla_id $ticket_sla_id \
-ticket_name $ticket_name \
-ticket_nr $ticket_nr \
-ticket_customer_contact_id $ticket_customer_contact_id \
-ticket_type_id $ticket_type_id \
-ticket_status_id $ticket_status_id \
-ticket_start_date $start_date \
-ticket_end_date $end_date \
-ticket_note $message \
Notice the code that sets the ticket’s name? It looks like this:
-ticket_name $ticket_name \
Too prevent duplicate names, we appended the ticket’s number to the ticket name. Since ticket numbers never duplicate (well, almost never — an article’s coming about that soon), you’re pretty much guaranteed to have a unique name. Here’s what the modified code looks like:
} -new_data {
set message ""
if {[info exists ticket_note]} { append message $ticket_note }
if {[info exists ticket_description]} { append message $ticket_description }
if {![exists_and_not_null project_name]} { set project_name $ticket_name}
set ticket_id [im_ticket::new \
-ticket_sla_id $ticket_sla_id \
-ticket_name "$ticket_name ($ticket_nr)" \
-ticket_nr $ticket_nr \
-ticket_customer_contact_id $ticket_customer_contact_id \
-ticket_type_id $ticket_type_id \
-ticket_status_id $ticket_status_id \
-ticket_start_date $start_date \
-ticket_end_date $end_date \
-ticket_note $message \
Notice that the specific line of code now reads:
-ticket_name "$ticket_name ($ticket_nr)" \
Now, Project Open will append the ticket number in parenthesis to every ticket name. When a user enter “My Computer is Broken”, the system will convert it to something like “My Computer is Broken (4118).”
That should give your users one less reason to curse your name!