Mandatory comment before resolve

Hi,
In my RT IR 5 I would like the owner to not be able to resolve the ticket if he does not enter anything in the comment. Therefore, I installed the extension : MandatoryOnTransition-0.24 and added the appropriate entries to the configuration (RT_SiteConfig.pm):

Set( %MandatoryOnTransition,
‘Zgłoszenia’ => {
‘* → resolved’ => [‘Respond’,‘Correspond’,‘Comment’,‘Comments’,‘CommentText’],
},
);

when I resolve a ticket, no warning appears. The ticket is simply closed.
Can anyone help me with this?

Hello.

I don’t know this extension but from the descriptoin I have an idea what happens.

The comment and the resove are two different Transactions so the system can not test any contraint. there will be other Comments or like this in the past with no assosiation to resolve.
It is possible to test for CutomField, only.

So an easy solution is to create a CustomField holding a short text for the solution. Maybe in combination with a CF “select one value” to classify the incident.

Hello,

I have no adhoc tip for the problem you have described. But I have another solution. You could customise the actions for your lifecycle. Simply delete the action that you don’t want. The best way to do this is to create a new lifecycle by cloning the defaul lifecycle. This way you have your original as a backup. For details see Customizing/Lifecycles - RT 5.0.7 Documentation - Best Practical

Hello guys,
I wrote a condition and it solved my problem. I’m posting the code, maybe it will be useful to someone:)

Custom condition:

return 0 unless $self->TransactionObj->Type eq “Status” && $self->TransactionObj->NewValue eq “resolved”;

my $transactions = $self->TicketObj->Transactions;

$transactions->Limit(FIELD => ‘Type’, VALUE => ‘Comment’);

if ($transactions->Count > 0) {
my $last_comment = $transactions->Last;

return 0 if $last_comment && $last_comment->CreatorObj->Name ne 'RT_System';

}

return 1;

Custom action preparation code:

return 1;

Custom action commit code:

$self->TicketObj->SetStatus(‘open’);

$self->TicketObj->Comment(Content => “Nie można zamknąć ticketa bez dodania komentarza.”);

return 1;