[rt-users] RT 4.4.1 - Change owner on corrospond Scrip - Strange issue

Alex Hall ahall at autodist.com
Thu Feb 23 13:10:53 EST 2017

Thank you! This seems to be doing the right thing, while still not
notifying the user of the change. It's exactly what I was hoping for. It
felt great to close the ticket my boss made on this issue back in November!

On Thu, Feb 23, 2017 at 12:06 PM, Shawn M Moore <shawn at bestpractical.com>

> Hey Robert, Alex,
> Is this just a display bug or are we not using the proper method to change
> the owner of the Ticket?
> You're not using the proper method.
> # do the actual 'status update'
> my ($status, $msg) = $self->TicketObj->_Set(Field => 'Owner', Value =>
> $Actor, RecordTransaction => 0);
> Should instead be:
> my ($status, $msg) = $self->TicketObj->SetOwner($Actor);
> What works: When user is first to correspond, Scrip executes and in Ticket
> view the Owner is set as expected.
> What doesn’t work: If we go into the queue and list all the open tickets,
> the owner will be listed as “nobody” in this view, but if you open the
> ticket, there is an owner. If you change the owner to someone else and
> change it back, then it seems to fix this issue.
> The reason you need to use SetOwner is that the owner of a ticket is
> represented in two different database tables. The first is in the
> GroupMembers table, alongside Requestors, Ccs, and AdminCcs, and custom
> roles. This is what provides features like permissions. It's also what's
> used when you display the "Owner" column in search results. Tickets _also_
> store their owner denormalized in the tickets table. This is used in, among
> other places, displaying the owner on ticket display, and in email
> notifications.
> ->Set(Field => 'Owner') only updates the latter. ->SetOwner updates both.
> This explains the inconsistencies you're seeing. Please try switching your
> scrip to ->SetOwner and seeing if it helps for tickets going forward. For
> existing tickets with this problem, you'll need to address the consistency
> issue.
> It turns out that, for different reasons entirely (
> https://issues.bestpractical.com/Ticket/Display.html?id=32381 ), RT 4.4.2
> adds an upgrade step and an rt-validator rule that detects and fixes such
> inconsistencies. You can find them here:
> https://github.com/bestpractical/rt/commit/58bacce6ada754657c7f56fd91f20c
> 573108c1ab
> https://github.com/bestpractical/rt/commit/20d8daf6855e3c53ee8a79d6827194
> 1d4cdca159
> Best,
> Shawn

Alex Hall
Automatic Distributors, IT department
ahall at autodist.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20170223/165eb30e/attachment.htm>

More information about the rt-users mailing list