[rt-users] Bug when merging tickets
Jesse Vincent
jesse at bestpractical.com
Fri Sep 28 21:08:46 EDT 2001
If the stats script is looking at tickets that have been merged into
other tickets, that's a bug in the stats script.
Jesse
On Wed, Sep 19, 2001 at 09:10:00AM +0200, Andreas Kruthoff wrote:
> Hi Jesse/all
>
> I think I've found a bug in RT207.
>
> Let me explain the behaviour:
> I ran the rt2stats script from Teo on my rt2 (mySQL) database.
> Everything seems to be fine except the 'Minimum time:' and the 'Average
> time:' for the 'Whole Database'. There are negative values of millions
> of seconds!
>
> Ok, I digged in to the rt2stats script, tying to find out where these
> values are coming from. Later, I recognized that there are rows in the
> 'Tickets' table of already resolved tickets that have a 'NULL' value
> instead of a timestamp. I found out that this was only the case for
> merged tickets. See the sql dump below:
>
>
> mysql> SELECT id,EffectiveId,Started,Resolved FROM Tickets WHERE
> IFNULL(Resolved,1)=1 and id!=EffectiveId;
> +-----+-------------+---------------------+----------+
> | id | EffectiveId | Started | Resolved |
> +-----+-------------+---------------------+----------+
> | 65 | 61 | 2001-08-21 09:58:28 | NULL |
> | 84 | 79 | NULL | NULL |
> | 120 | 118 | NULL | NULL |
> | 121 | 118 | NULL | NULL |
> | 123 | 124 | NULL | NULL |
> | 163 | 79 | 2001-09-06 11:57:11 | NULL |
> | 191 | 79 | NULL | NULL |
> | 225 | 219 | NULL | NULL |
> | 307 | 76 | NULL | NULL |
> | 315 | 314 | NULL | NULL |
> +-----+-------------+---------------------+----------+
> 10 rows in set (0.00 sec)
>
> mysql> SELECT id,EffectiveId,Started,Resolved FROM Tickets WHERE id='61';
> +----+-------------+---------------------+---------------------+
> | id | EffectiveId | Started | Resolved |
> +----+-------------+---------------------+---------------------+
> | 61 | 61 | 2001-08-17 08:42:53 | 2001-09-18 15:28:29 |
> +----+-------------+---------------------+---------------------+
> 1 row in set (0.00 sec)
>
> mysql> SELECT id,EffectiveId,Started,Resolved FROM Tickets WHERE id='65';
> +----+-------------+---------------------+----------+
> | id | EffectiveId | Started | Resolved |
> +----+-------------+---------------------+----------+
> | 65 | 61 | 2001-08-21 09:58:28 | NULL |
> +----+-------------+---------------------+----------+
> 1 row in set (0.00 sec)
>
>
> I updated the id 65:
>
> mysql> UPDATE Tickets SET Resolved='2001-09-18 15:28:29' WHERE id=65;
> Query OK, 1 row affected (0.00 sec)
> Rows matched: 1 Changed: 1 Warnings: 0
>
> mysql> SELECT id,EffectiveId,Started,Resolved FROM Tickets WHERE id='65';
> +----+-------------+---------------------+---------------------+
> | id | EffectiveId | Started | Resolved |
> +----+-------------+---------------------+---------------------+
> | 65 | 61 | 2001-08-21 09:58:28 | 2001-09-18 15:28:29 |
> +----+-------------+---------------------+---------------------+
> 1 row in set (0.00 sec)
>
>
> After updateing all 10 tickets, I ran the rt2stats script again and it
> produces the output I wished ;-)
>
> Ahm - to make a long story short: please update the 'Resolved' field of
> the merged ticket if the effective ticket gets the status resolved.
>
> have fun,
>
> -andreas
>
>
> _______________________________________________
> rt-users mailing list
> rt-users at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-users
>
--
http://www.bestpractical.com/products/rt -- Trouble Ticketing. Free.
More information about the rt-users
mailing list