Re: [rt-users] Cancel "Resolve" transaction based on custom fields

2015-01-30 Thread Jasper Olbrich


On 01/29/2015 11:52 PM, Kevin Falcone wrote:
> On Thu, Jan 29, 2015 at 03:04:55PM -0500, Alex Vandiver wrote:
>> On Wed, 28 Jan 2015 14:27:22 +0100 Jasper Olbrich
>>  wrote:
>>> Is it possible to suppress the status change from open to resolved
>>> with a scrip or to include the scrip-induced status change in the
>>> result box?
>>
>> Unfortunately, neither of these is possible in stock RT.  Scrips can
>> only run _after_ a chance has happened, and thus have no chance of
>> preventing it.  They also cannot currently push their results to the
>> user.
> 
> If you merely need "has a value" rather than "has a specific value"
> you may want
> https://metacpan.org/release/RT-Extension-MandatoryOnTransition

I need "has a value iff another CF has a special value". Thanks for the
hint, I'll have a look at this extension.

-- 
Jasper Olbrich


Re: [rt-users] Cancel "Resolve" transaction based on custom fields

2015-01-29 Thread Landon Stewart
On Jan 29, 2015, at 3:05 PM, Landon Stewart  wrote:
> In the action (commit) section of the Scrip:
> $self->TicketObj->Status("open");
> $self->TicketObj->Comment( Content => "Script re-opened because 
> CustomFieldName is 
> ".$self->TicketObj->FirstCustomFieldValue("CustomFieldName") );

Oops.  Should read "Ticket re-opened because..."

And it should be followed by:

return 1;


Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Cancel "Resolve" transaction based on custom fields

2015-01-29 Thread Landon Stewart
On Jan 28, 2015, at 5:27 AM, Jasper Olbrich 
 wrote:
> 
> Hello,
> 
> I want to cancel or undo the "Mark as Resolved" transaction based on the 
> content of custom fields. Currently I'm using a Scrip and I'm only able to do 
> the following:
> 
> * access the custom fields
> * make the decision
> * comment on the ticket with the reason why it can't be resolved
> * reopen the ticket
> 
> From the ticket's history, I can tell that it is resolved first, then my 
> scrip adds the comment and reopens it. But yellow "Results" box shows only 
> "Status changed from open to resolved".
> 
> Is it possible to suppress the status change from open to resolved with a 
> scrip or to include the scrip-induced status change in the result box?

I hope I'm understanding this correctly...

I would use a Scrip with a condition of "On Resolve" and have the scrip 
evaluate the ticket to see if it should be reopened.  If it should be reopened 
the action portion of the scrip would open the ticket via 
$self->TicketObj->Status("open") again.

Name of Scrip:
"On Resolve Reopen if CustomFieldName Contains Some Text"

Condition: Select "On Resolve"

In the preparation section of the Scrip:
return 0 unless $self->TicketObj->FirstCustomFieldValue("CustomFieldName") =~ 
/Some Text/;
return 1;

In the action (commit) section of the Scrip:
$self->TicketObj->Status("open");
$self->TicketObj->Comment( Content => "Script re-opened because CustomFieldName 
is ".$self->TicketObj->FirstCustomFieldValue("CustomFieldName") );

Maybe?

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Cancel "Resolve" transaction based on custom fields

2015-01-29 Thread Kevin Falcone
On Thu, Jan 29, 2015 at 03:04:55PM -0500, Alex Vandiver wrote:
> On Wed, 28 Jan 2015 14:27:22 +0100 Jasper Olbrich
>  wrote:
> > Is it possible to suppress the status change from open to resolved
> > with a scrip or to include the scrip-induced status change in the
> > result box?
> 
> Unfortunately, neither of these is possible in stock RT.  Scrips can
> only run _after_ a chance has happened, and thus have no chance of
> preventing it.  They also cannot currently push their results to the
> user.

If you merely need "has a value" rather than "has a specific value"
you may want
https://metacpan.org/release/RT-Extension-MandatoryOnTransition

Regardless, you may be able to use its code to write your preferred
solution that cancels the Resolve.

-kevin


pgplDf3sO4bdD.pgp
Description: PGP signature


Re: [rt-users] Cancel "Resolve" transaction based on custom fields

2015-01-29 Thread Alex Vandiver
On Wed, 28 Jan 2015 14:27:22 +0100 Jasper Olbrich
 wrote:
> Is it possible to suppress the status change from open to resolved
> with a scrip or to include the scrip-induced status change in the
> result box?

Unfortunately, neither of these is possible in stock RT.  Scrips can
only run _after_ a chance has happened, and thus have no chance of
preventing it.  They also cannot currently push their results to the
user.
 - Alex


[rt-users] Cancel "Resolve" transaction based on custom fields

2015-01-28 Thread Jasper Olbrich

Hello,

I want to cancel or undo the "Mark as Resolved" transaction based on the 
content of custom fields. Currently I'm using a Scrip and I'm only able 
to do the following:


* access the custom fields
* make the decision
* comment on the ticket with the reason why it can't be resolved
* reopen the ticket

From the ticket's history, I can tell that it is resolved first, then 
my scrip adds the comment and reopens it. But yellow "Results" box shows 
only "Status changed from open to resolved".


Is it possible to suppress the status change from open to resolved with 
a scrip or to include the scrip-induced status change in the result box?


--
Regards,
Jasper Olbrich