<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi all,<br>
<br>
I'm using RT 4.2.8 and would like to prevent ticket resolution in
which the owner is "Nobody".<br>
For that I'm doing two steps:<br>
<ul>
<li><b> Change the custom condition of scrip "On Resolve Notify
Requestors" to not notify requesters if Owner is 'Nobody':</b></li>
</ul>
<b>Description:</b> On Resolve Notify Requestors<br>
<b>Condition:</b> User Defined<br>
<b>Action:</b> Notify Requestors<br>
<b>Template:</b> resolved in HTML<br>
<br>
<b>Custom condition:</b><br>
if((<br>
($self->TransactionObj->Type eq 'Status') or <br>
($self->TransactionObj->Type eq 'Set' and
$self->TransactionObj->Field eq 'Status')<br>
) and <br>
$self->TransactionObj->NewValue eq 'resolved'<br>
) {<br>
if($self->TicketObj->Owner == $RT::Nobody->id)
{<br>
$RT::Logger->debug("Do not notify requestors if
Owner is Nobody");<br>
return 0;<br>
} else {<br>
return 1;<br>
}<br>
}<br>
<br>
return 0;<br>
<ul>
<li><b>Create scrip to change status from resolved to it's old
value:</b></li>
</ul>
<b>Description:</b> On Resolve Check Owner<br>
<b>Condition:</b> On Resolve<br>
<b>Action:</b> User Defined<br>
<b>Template:</b> Blank<br>
<br>
<b> Custom action commits code:</b><br>
# get actor ID<br>
my $Actor = $self->TransactionObj->Creator;<br>
<br>
# if actor is RT_SystemUser then get out of here<br>
return 1 if $Actor == $RT::SystemUser->id;<br>
<br>
return 1 unless $self->TicketObj->Owner ==
$RT::Nobody->id;<br>
<br>
my ($status, $msg) =
$self->TicketObj->SetStatus($self->TransactionObj->OldValue);<br>
unless($status) {<br>
$RT::Logger->error("Error when setting new status:
$msg");<br>
return undef;<br>
}<br>
<br>
$RT::Logger->debug("Status changed");<br>
<br>
return 1;<br>
<br>
<i>(The scrips above are divided just for separation of concerns
purposes)</i><br>
<br>
It works, but the message that appears confuses the user: "Status
changed from 'open' to 'resolved'". But in fact, the status of the
ticket is "open" (setted in scrip above).<br>
<br>
Actually I would like to "lock" the screen, warning the user that it
is necessary to assign an owner before resolving the ticket.<br>
<br>
Someone suggests a better solution? How could I lock the screen and
display a message to the user?<br>
<br>
I tried using the plugin "MandatoryOnTransition" for this purpose,
but does not work because it just considers empty fields, and the
owner is set to "Nobody", not empty:<br>
Set (% MandatoryOnTransition,<br>
'*' => {<br>
'* -> Resolved' => ['TimeWorked', 'Owner'],<br>
},<br>
);<br>
<br>
Please help me.<br>
<br>
Thanks in advance.<br>
<pre class="moz-signature" cols="72">--
Murillo Azambuja Gonçalves
</pre>
</body>
</html>