[rt-users] How to determine if TimeWorked comes from merge transaction.

Ruslan Zakirov ruz at bestpractical.com
Tue Jun 4 10:03:47 EDT 2013


On Mon, Jun 3, 2013 at 11:20 PM, Ryszard Łach <ryszard.lach at unity.pl> wrote:

> On 06/03/13 18:58, Kevin Falcone wrote:
> > TimeWorked and Merges is a bit of a mess, but has been cleaned up a
> > tiny bit in alter 4.0s and definitely on master (what will be 4.2).
> > It'd be a lot easier to get a sense of what you're seeing if you
> > showed us the transactions you're looking at. -kevin
>
> Sure.
>
> Transactions of the merged ticket:
>
>    id    | objecttype | objectid | timetaken |    type    |   field    |
> oldvalue |               newvalue
>
> ---------+------------+----------+-----------+------------+------------+----------+---------------------------------------
>   223234 | RT::Group  |    94774 |         0 | Create     |            |
>        |
>  1484144 | RT::Ticket |    94774 |         0 | Create     |            |
>        |
>  1484452 | RT::Ticket |    94774 |        60 | Comment    |            |
>        |
>  1486176 | RT::Ticket |    94774 |        61 | Comment    |            |
>        |
>  1486211 | RT::Ticket |    94774 |        44 | Comment    |            |
>        |
>  1521779 | RT::Ticket |    94774 |       144 | Comment    |            |
>        |
>  1526080 | RT::Ticket |    94774 |         0 | Set        | Owner      |
> 247901   | 388545
>  1526573 | RT::Ticket |    94774 |        45 | Comment    |            |
>        |
>  1527417 | RT::Ticket |    94774 |       240 | Correspond |            |
>        |
>  1528176 | RT::Ticket |    94774 |        30 | Comment    |            |
>        |
>  1529378 | RT::Ticket |    94774 |       100 | Comment    |            |
>        |
>  1533693 | RT::Ticket |    94774 |        90 | Comment    |            |
>        |
>  1533695 | RT::Ticket |    94774 |         0 | AddLink    | MergedInto |
>        | fsck.com-rt://.../ticket/95112
>
> Transactions of the target ticket
>
>    id    | objecttype | objectid | timetaken |    type    |   field    |
> oldvalue |               newvalue
>
> ---------+------------+----------+-----------+------------+------------+----------+---------------------------------------
>   224132 | RT::Group  |    95112 |         0 | Create     |            |
>        |
>  1490734 | RT::Ticket |    95112 |         0 | Create     |            |
>        |
>  1493108 | RT::Ticket |    95112 |         0 | Set        | Owner      |
> 10       | 22
>  1493120 | RT::Ticket |    95112 |         0 | Correspond |            |
>        |
>  1493562 | RT::Ticket |    95112 |         0 | Comment    |            |
>        |
>  1493664 | RT::Ticket |    95112 |         0 | Set        | Owner      |
> 22       | 384890
>  1493671 | RT::Ticket |    95112 |        10 | Comment    |            |
>        |
>  1499857 | RT::Ticket |    95112 |       125 | Comment    |            |
>        |
>  1508951 | RT::Ticket |    95112 |       145 | Comment    |            |
>        |
>  1533694 | RT::Ticket |    95112 |         0 | Set        | TimeWorked |
> 280      | 1094
>  1533696 | RT::Ticket |    95112 |         0 | AddLink    | MergedInto |
>        | fsck.com-rt://.../ticket/95112
>  1533711 | RT::Ticket |    95112 |         0 | Set        | Owner      |
> 384890   | 22
>  1533715 | RT::Ticket |    95112 |         0 | Set        | Owner      |
> 22       | 388545
>  1533721 | RT::Ticket |    95112 |        61 | Comment    |            |
>        |
>  1535978 | RT::Ticket |    95112 |         0 | Comment    |            |
>        |
>  1535980 | RT::Ticket |    95112 |         0 | Status     | Status     |
> new      | resolved
>
>
> Transaction no. 1533694 has been created to increase TimeWorked in ticket
> 95112 by sum of timeworked in ticket 94774.
>
>
> However, I found a way: every time I find 'Set TimeWorked' transaction
> I'm listing all the transactions of the related ticket, check next one
> transaction (after Set TimeWorked) and I skip the Time Worked if the
> next one is 'AddLink MergedInto'.
>
> Not too elegant (some lines of code), but it seems it will have to be
> enough for some time, right?
>

Yes. It will be. In RT 4.2 upgrade script does similar thing, but also
checks that after throwing away all these candiate txtns the time on ticket
is consistent with other transactions.



>
> Cheers,
>
> R.
>
>
>
>
>
> --
> RT Training in Seattle, June 19-20: http://bestpractical.com/training
>



-- 
Best regards, Ruslan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130604/2bf66600/attachment.htm>


More information about the rt-users mailing list