<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I resolved that issue editing the plugin file
"MandatoryOnTransition.pm" (v. 0.09), by doing it accept the Owner
field:<br>
<br>
line 206<br>
line 207<br>
...<br>
our @CORE_SUPPORTED = qw(Content TimeWorked TimeTaken <b>Owner</b>);<br>
our @CORE_TICKET = qw(TimeWorked <b>Owner</b>);<br>
our %CORE_FOR_UPDATE = (<br>
TimeWorked => 'UpdateTimeWorked',<br>
TimeTaken => 'UpdateTimeWorked',<br>
Content => 'UpdateContent',<br>
<b>Owner => 'Owner',</b><br>
);<br>
our %CORE_FOR_CREATE = (<br>
TimeWorked => 'TimeWorked',<br>
Content => 'Content',<br>
<b>Owner => 'Owner',</b><br>
);<br>
...<br>
line 221<br>
...<br>
<br>
line 338<br>
...<br>
# Check core fields, after canonicalization for update<br>
for my $field (@$core) {<br>
<br>
# Will we have a value on update/create?<br>
my $arg = $args{'Ticket'}<br>
? $CORE_FOR_UPDATE{$field}<br>
: $CORE_FOR_CREATE{$field};<br>
next unless $arg;<br>
next if defined $ARGSRef->{$arg} and length
$ARGSRef->{$arg};<br>
<br>
<b> if($field eq 'Owner' and
$args{'Ticket'}->$field() == $RT::Nobody->id) {</b><b><br>
</b><b> push @errors,</b><b><br>
</b><b> $CurrentUser->loc("[_1] is required when
changing the status to [_2]",</b><b><br>
</b><b>
$field,
$ARGSRef->{Status});</b><b><br>
</b><b> }</b><br>
<br>
# Do we have a value currently?<br>
# In Create the ticket hasn't been created yet.<br>
next if grep { $_ eq $field } @CORE_TICKET<br>
and ($args{'Ticket'} &&
$args{'Ticket'}->$field());<br>
<br>
(my $label = $field) =~ s/(?<=[a-z])(?=[A-Z])/ /g; #
/<br>
push @errors,<br>
$CurrentUser->loc("[_1] is required when changing
the status to [_2]",<br>
$label,
$ARGSRef->{Status});<br>
}<br>
line 365<br>
...<br>
<br>
I wanted to do it without changes in the source code, but i couldn't
find a way until this moment.<br>
If anybody has a better idea or knows how to do it without changes
in the code please tell me.<br>
<br>
Anyway here's how I solved that.<br>
<br>
Regards,<br>
<br>
<pre class="moz-signature" cols="72">Murillo Azambuja Gonçalves
____________________________________________________
</pre>
<div class="moz-cite-prefix">On 07/16/2015 12:05 PM, Murillo
Azambuja Gonçalves wrote:<br>
</div>
<blockquote cite="mid:55A7C854.3010901@ifi.unicamp.br" type="cite">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
This can not be done here.<br>
In some queues those responsible for sending transactions
(including tickets resolution) are not directly involved in the
work of tickets.<br>
<br>
Even I used the scrip "<a moz-do-not-send="true"
href="http://requesttracker.wikia.com/wiki/AutoSetOwner">AutoSetOwner</a>"
as a basis to create mine.<br>
<br>
Anyway thanks for your answer.<br>
Would have another suggestion?<br>
<pre class="moz-signature" cols="72">Murillo Azambuja Gonçalves
____________________________________________________
</pre>
<div class="moz-cite-prefix">On 07/16/2015 11:37 AM, Matt
Zagrabelny wrote:<br>
</div>
<blockquote
cite="mid:CAOLfK3UTC6aLm=2V30MEtqZFCwWhhKm7gLP54_pGk=Z9en2w4Q@mail.gmail.com"
type="cite">
<pre wrap="">Hi,
I didn't read everything in your email. :)
Have you considered a lifecycle where only the Owner is granted the
right to resolve the ticket?
-m
On Thu, Jul 16, 2015 at 9:34 AM, Murillo Azambuja Gonçalves
<a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:murillo@ifi.unicamp.br"><murillo@ifi.unicamp.br></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi all,
I'm using RT 4.2.8 and would like to prevent ticket resolution in which the
owner is "Nobody".
For that I'm doing two steps:
Change the custom condition of scrip "On Resolve Notify Requestors" to not
notify requesters if Owner is 'Nobody':
Description: On Resolve Notify Requestors
Condition: User Defined
Action: Notify Requestors
Template: resolved in HTML
Custom condition:
if((
($self->TransactionObj->Type eq 'Status') or
($self->TransactionObj->Type eq 'Set' and
$self->TransactionObj->Field eq 'Status')
) and
$self->TransactionObj->NewValue eq 'resolved'
) {
if($self->TicketObj->Owner == $RT::Nobody->id) {
$RT::Logger->debug("Do not notify requestors if Owner is
Nobody");
return 0;
} else {
return 1;
}
}
return 0;
Create scrip to change status from resolved to it's old value:
Description: On Resolve Check Owner
Condition: On Resolve
Action: User Defined
Template: Blank
Custom action commits code:
# get actor ID
my $Actor = $self->TransactionObj->Creator;
# if actor is RT_SystemUser then get out of here
return 1 if $Actor == $RT::SystemUser->id;
return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
my ($status, $msg) =
$self->TicketObj->SetStatus($self->TransactionObj->OldValue);
unless($status) {
$RT::Logger->error("Error when setting new status: $msg");
return undef;
}
$RT::Logger->debug("Status changed");
return 1;
(The scrips above are divided just for separation of concerns purposes)
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).
Actually I would like to "lock" the screen, warning the user that it is
necessary to assign an owner before resolving the ticket.
Someone suggests a better solution? How could I lock the screen and display
a message to the user?
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:
Set (% MandatoryOnTransition,
'*' => {
'* -> Resolved' => ['TimeWorked', 'Owner'],
},
);
Please help me.
Thanks in advance.
--
Murillo Azambuja Gonçalves
</pre>
</blockquote>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>