I'm working on implementing a ticketing system based on this module. I already have an older system which we are using but wanted to take advantage of having it integrated with Drupal. One feature which I use on our old system is the ability to search for a ticket by its number. Many times you want to quickly get to an issue and you know its id.
The way I think it should work is that, when I enter just a number (or maybe something like: #NN or id:NN) in the search field, the system should try to do a node_load(), and if it succeeds to load a ticket should re-direct to it.
There are a couple of issue here: if you don't use a prefix like # or id: then I think it should try to load the ticket but also perform a search and return the ticket as the first item and the rest of the items if there were some. If the results are only one then it should redirect to it.
Another option is to always show the search results but I find it more convenient to do a re-direct to the ticket when one is searching for a ticket.

So, basically I have this almost implemented and my questions are:

  1. Is there any interest in this feature?
  2. Would you prefer a prefix like #nn o id:nn or just the number?

If there is interest let me know and I'll submit the patch.

Comments

jeremy’s picture

Category: feature » support
Status: Active » Fixed

Support tickets are just Drupal nodes. Thus, if you know the ticket # you can load up the ticket by visiting:
http://sample.com/node/<ticket#>

Replace sample.com with your own domain, and <ticket#> with your ticket number. (This will work even if you are creating aliases for your tickets.)

Feel free to re-open if I'm missing something and there's more that you want to do.

cesarmiquel’s picture

Status: Fixed » Active

Indeed. I know that you can access it this way. Its just that I think it is more convenient to be able to just enter the ID in the search box and get automatically redirected to it. You and me are Drupal users/developer and we memorize URLs very easily. Most users will probably forget the URL but they would definitively remember to just enter the ID. In fact I favor the approach where you don't need to add a prefix because if there is a prefix then you have to remember that.

Right know I added this code to the support_search() function:

function support_serach($op = 'search', $keys = NULL) {
      ....
      else {
        $select2 = implode(' + ', $ranking) . ' AS score';
      }

      // NEW CODE ---------------------------------------------------------------
      // Do search. First check if user entered a single number. 
      // If they did we assume its the ticket # and we load it into
      // the result array.
      $nid = null;
      if ( count($keys) == 1 && is_numeric($keys) ) {
        $node = node_load( $keys );
        if ( $node && $node->type == 'support_ticket' && $node->status ) {
          $nid = $keys;
        }
      }
      $find = do_search($keys, 'node', $join, $conditions, $arguments, $select2, $join2, $arguments2);

      if (count($find) == 0 && $nid) {
        drupal_goto('node/' . $nid);
      }

      // END NEW CODE ----------------------------------------------------------------

      // Load results.
      $results = array();
      foreach ($find as $item) {
      ....

So: to wrap up: I agree with you that you can access the ticket by writing the URL. But I think for the user its much simpler to be able to write the id in the search box and get redirected to the ticket. In the implementation I working on I have a search box on every page and my idea is that you can use this to get quickly to a ticket.
This is really a usability issue. Since you are the owner of this module you get to decide if you think this feature is useful. If you decide this feature is useless I can implement this in JS using JQuery for my site. I won't hold any hard feelings towards you if you reject it ;-).

jeremy’s picture

Category: support » feature
Status: Active » Closed (won't fix)

I'd prefer seeing this as a third-party module, not included with the core support module. I agree that some may find it useful, but I see it as unnecessary to the core support ticketing system. If you decide to create a project that offers this as an add-on module, please let me know and I'll add a link from the main project.

span’s picture

This looks very interesting to me as my users dont even know what a URL is. Was this ever ported to it's own module?