Fog Creek Software
Discussion Board

Assigning reopened cases to the one who closed it


When a case is reopened because of an incoming email that bears the case number, is there a way to automatically assign the case to the person who closed the it? Currently, it is assigned to the default "assign to" person for that Mailbox.

Our scenario is:

When an incoming email is processed by FB, it is assigned to a generic "Technical Support" user. Then, a support agent assigns the case to himself and take care of it.

Ultimately, the agent will use the "Send&Close" button on the Reply form when all the customer's questions have been adressed. If that customer replies to the email, the bug is reopened (which is good), but it is reassigned to "Technical Support".

It would be more appropriate in this scenario for the reopened case to be assigned to the agent that did the "Send&Close" reply, since he's the one who should handle the customer's reply.



Pascal Bourque
Wednesday, May 14, 2003

I patched dispatcho.asp to achieve this. Here's the code, in case anyone would like to do the same thing. It is not necessarily the best way to do it, but it works. If anyone comes up with a better approach, I'd be happy to adopt it! :)

Version modified: 3.1.15

File modified: dispatcho.asp

Near the end of the file, locate the following lines of code:

If Not c.fOpen Then
    c.ixPersonAssignedTo = ixPersonAssignedTo
    c.ReOpen ixPersonOpenedBy, sText, "", True, True
ElseIf c.ixStatus <> 1 Then
    c.ixPersonAssignedTo = ixPersonAssignedTo
    c.ReActivate ixPersonOpenedBy, sText, "", True, True
    ' don't need to change person its assigned to if bug is still open
    c.Edit ixPersonOpenedBy, sText, "", True, True
End If

Replace the code in the [If Not c.fOpen Then] block by this:

'The incoming email matches an existing Case that has been closed.
'Instead of assigning the reopened case to the person configured in
'the Mailbox, assign it to the person who closed the bug. This is
'because that person is the one who should take care of the email that
'reopened the case he closed.

'Loop through the BugEventList for that case, in descending order.
'When a Closed event is found, retrieve the ixPerson that closed it
'and assign the reopened case to that person.

Dim bel : Set bel = New CBugEventList
bel.Load c.ixBug, False
Do While Not bel.EOF
    Dim ev : Set ev = bel.GetNextEvent
    If( ev.evt = evtClosed ) Then
        c.ixPersonAssignedTo = ev.ixPerson
        Exit Do
    End If

'If nobody has been found in the BugEventList, assign it to the
'person configured in the Mailbox.

If( c.ixPersonAssignedTo = 1 ) Then
    c.ixPersonAssignedTo = ixPersonAssignedTo
End If
c.ReOpen ixPersonOpenedBy, sText, "", True, True

That's it!


Pascal Bourque
Thursday, May 15, 2003

Added to the feature list.  Thanks!

Michael H. Pryor
Wednesday, May 28, 2003

*  Recent Topics

*  Fog Creek Home