Re: [rt-users] SetStatus and SetOwner scrip question

2009-09-25 Thread Mike Johnson
Hi Kevin,
 
Thx for that tidbit of info,
 
In that file I found the correct syntax, out of Sean's set, the 2 below will 
work,
 
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);
 
But, this is baffling me...
 
This is my scrip
 
Condition: On Queue Change
Action: User Defined
Custom action Preparation Code:
# set new Ticket Owner value
my $ticket = $self-TicketObj;
$ticket-SetStatus(new);
$ticket-SetOwner(Nobody);
 
Based on the above investigation, I know the syntax is correct for the 
SetOwner.  However, the only thing that happens on queue change is the ticket's 
status is set to new.  That shows up in the ticket history.  The SetOwner 
doesn't show up at all, nothing happens.
 
This is the exact same spot Sean got stuck and the thread ended.
 
 
Ken Crocker(thx Ken) provided the above code + 1 line (return 1;) and said his 
is in the cleanup code spot.  If I put that code in there, absolutely nothing 
gets changed in the ticket...
 
Any thoughts anyone?
 
 
 
 
 
Mike Johnson
Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON   P7B 5E1
Phone: 807.766.7331
Email: mike.john...@normed.ca 
Technology assistance: email nosmhelpd...@normed.ca 
Technology Emergency Contact (TEC) Mon-Fri, 8am to 5pm excluding stat holidays: 
Off campus toll free 1-800-461-8777, option 8, or locally either 
(705)-662-7120 or (807)-766-7500


 Kevin Falcone falc...@bestpractical.com 24/09/2009 5:06 pm 
On Thu, Sep 24, 2009 at 04:02:10PM -0400, Mike Johnson wrote:
I was looking through the list's history.
 
The original email did not get an answer to it.
 
The piece that interests me about this listserv topic(dating back to Aug 
 2007)
 
 
Sean, and myself are trying to set a ticket's owner to nobody on an 
 action...
 
He stated,
 
I've tried:
 
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Id = 10);
$self-TicketObj-SetOwner(Id = 10);
 
None of these has worked and nothing in rt.log indicates any problems.  I 
 have
it set up with debug so I know I'm getting as much info as I can.

If you want as much information as possible, you should check the
return values of SetOwner.  The arguments for the SetOwner method are
documented in Ticket_Overlay.pm.

-kevin

Can anyone tell me which of the above? and what else do I need to set to 
 make this happen on a
specific condition(I'm using On Queue change).
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Re: [rt-users] SetStatus and SetOwner scrip question

2009-09-25 Thread Kevin Falcone
On Fri, Sep 25, 2009 at 09:55:23AM -0400, Mike Johnson wrote:
Hi Kevin,
 
Thx for that tidbit of info,
 
In that file I found the correct syntax, out of Sean's set, the 2 below 
 will work,
 
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);

You're not checking return values.

my ($status, $msg) = 
log the status and message and find out why it isn't being set

-kevin

But, this is baffling me...
 
This is my scrip
 
Condition: On Queue Change
Action: User Defined
Custom action Preparation Code:
# set new Ticket Owner value
my $ticket = $self-TicketObj;
$ticket-SetStatus(new);
$ticket-SetOwner(Nobody);
 
Based on the above investigation, I know the syntax is correct for the 
 SetOwner.  However, the
only thing that happens on queue change is the ticket's status is set to 
 new.  That shows up
in the ticket history.  The SetOwner doesn't show up at all, nothing 
 happens.
 
This is the exact same spot Sean got stuck and the thread ended.
 
 
Ken Crocker(thx Ken) provided the above code + 1 line (return 1;) and said 
 his is in the
cleanup code spot.  If I put that code in there, absolutely nothing gets 
 changed in the
ticket...
 
Any thoughts anyone?
 
 
 
 
 
Mike Johnson
Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON   P7B 5E1
Phone: 807.766.7331
Email: [1]mike.john...@normed.ca
Technology assistance: email [2]nosmhelpd...@normed.ca
Technology Emergency Contact (TEC) Mon-Fri, 8am to 5pm excluding stat 
 holidays:
Off campus toll free 1-800-461-8777, option 8, or locally either
(705)-662-7120 or (807)-766-7500
 
 Kevin Falcone falc...@bestpractical.com 24/09/2009 5:06 pm 
On Thu, Sep 24, 2009 at 04:02:10PM -0400, Mike Johnson wrote:
I was looking through the list's history.

The original email did not get an answer to it.

The piece that interests me about this listserv topic(dating back to 
 Aug 2007)


Sean, and myself are trying to set a ticket's owner to nobody on an 
 action...

He stated,

I've tried:

$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Id = 10);
$self-TicketObj-SetOwner(Id = 10);

None of these has worked and nothing in rt.log indicates any 
 problems.  I have
it set up with debug so I know I'm getting as much info as I can.
 
If you want as much information as possible, you should check the
return values of SetOwner.  The arguments for the SetOwner method are
documented in Ticket_Overlay.pm.
 
-kevin
 
Can anyone tell me which of the above? and what else do I need to set 
 to make this happen
on a
specific condition(I'm using On Queue change).
 
 References
 
Visible links
1. mailto:mike.john...@normed.ca
2. mailto:nosmhelpd...@normed.ca

 ___
 http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
 
 Community help: http://wiki.bestpractical.com
 Commercial support: sa...@bestpractical.com
 
 
 Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
 Buy a copy at http://rtbook.bestpractical.com



pgpMWCTfCmXWw.pgp
Description: PGP signature
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Re: [rt-users] SetStatus and SetOwner scrip question

2009-09-25 Thread Ken Crocker

Mike,

You didn't get my code correct. You forgot the Force. (NO, I'm NOT 
saying may the force be with you, gaagh!).
Also, when creating a scrip, you must keep in mind that when you define 
the condition as :User-Defined, you SHOULD end with a return code in 
both the Prep  Cleanup areas. Since my code is in the Cleanup 
area, I have a return 1; in the Prep area. That way RT knows to 
continue on to the cleanup area. So, to re-cap, your code should look 
something like this:


Condition: On whatever
Action: User-Defined

Custom Prep Code:
Return 1;

Custom Cleanup Code:

# set new Ticket Owner value
my $ticket = $self-TicketObj;
$ticket-SetStatus('new');
$ticket-SetOwner(10, 'Force');
return 1;

That should do it. Hope this helps.

Kenn
LBNL

On 9/25/2009 6:55 AM, Mike Johnson wrote:

Hi Kevin,
 
Thx for that tidbit of info,
 
In that file I found the correct syntax, out of Sean's set, the 2 
below will work,
 
$self-TicketObj-SetOwner(Nobody);

$self-TicketObj-SetOwner(10);
 
But, this is baffling me...
 
This is my scrip
 
Condition: On Queue Change

Action: User Defined
Custom action Preparation Code:
# set new Ticket Owner value
my $ticket = $self-TicketObj;
$ticket-SetStatus(new);
$ticket-SetOwner(Nobody);
 
Based on the above investigation, I know the syntax is correct for the 
SetOwner.  However, the only thing that happens on queue change is the 
ticket's status is set to new.  That shows up in the ticket history.  
The SetOwner doesn't show up at all, nothing happens.
 
This is the exact same spot Sean got stuck and the thread ended.
 
 
Ken Crocker(thx Ken) provided the above code + 1 line (return 1;) and 
said his is in the cleanup code spot.  If I put that code in there, 
absolutely nothing gets changed in the ticket...
 
Any thoughts anyone?
 
 
 
 
 
Mike Johnson

Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON   P7B 5E1
Phone: 807.766.7331
Email: mike.john...@normed.ca mailto:mike.john...@normed.ca
Technology assistance: email nosmhelpd...@normed.ca 
mailto:nosmhelpd...@normed.ca
Technology Emergency Contact (TEC) Mon-Fri, 8am to 5pm excluding stat 
holidays:

Off campus toll free 1-800-461-8777, option 8, or locally either
(705)-662-7120 or (807)-766-7500


 Kevin Falcone falc...@bestpractical.com 24/09/2009 5:06 pm 
On Thu, Sep 24, 2009 at 04:02:10PM -0400, Mike Johnson wrote:
I was looking through the list's history.

The original email did not get an answer to it.

The piece that interests me about this listserv topic(dating back 
to Aug 2007)



Sean, and myself are trying to set a ticket's owner to nobody on 
an action...


He stated,

I've tried:

$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Id = 10);
$self-TicketObj-SetOwner(Id = 10);

None of these has worked and nothing in rt.log indicates any 
problems.  I have

it set up with debug so I know I'm getting as much info as I can.

If you want as much information as possible, you should check the
return values of SetOwner.  The arguments for the SetOwner method are
documented in Ticket_Overlay.pm.

-kevin

Can anyone tell me which of the above? and what else do I need to 
set to make this happen on a

specific condition(I'm using On Queue change).


___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Re: [rt-users] SetStatus and SetOwner scrip question

2009-09-25 Thread Mike Johnson
Thank you very much Ken.
 
I am new to coding custom action codes, and didn't see the part where you need 
to tell the script to move on from custom action prep. on this page ...
 
http://wiki.bestpractical.com/view/WriteCustomAction 
 
 
I was trying to move too fast :P.
 
Thx for pointing that out.
 
It is definitely working now.
 
Mike Johnson
Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON   P7B 5E1
Phone: 807.766.7331
Email: mike.john...@normed.ca 
Technology assistance: email nosmhelpd...@normed.ca 
Technology Emergency Contact (TEC) Mon-Fri, 8am to 5pm excluding stat holidays: 
Off campus toll free 1-800-461-8777, option 8, or locally either 
(705)-662-7120 or (807)-766-7500


 Ken Crocker kfcroc...@lbl.gov 25/09/2009 12:19 pm 
Mike,

You didn't get my code correct. You forgot the Force. (NO, I'm NOT saying 
may the force be with you, gaagh!). 
Also, when creating a scrip, you must keep in mind that when you define the 
condition as :User-Defined, you SHOULD end with a return code in both the 
Prep  Cleanup areas. Since my code is in the Cleanup area, I have a 
return 1; in the Prep area. That way RT knows to continue on to the cleanup 
area. So, to re-cap, your code should look something like this:

Condition: On whatever
Action: User-Defined

Custom Prep Code:
Return 1;

Custom Cleanup Code:

# set new Ticket Owner value
my $ticket = $self-TicketObj;
$ticket-SetStatus('new');
$ticket-SetOwner(10, 'Force');
return 1;

That should do it. Hope this helps.

Kenn
LBNL

On 9/25/2009 6:55 AM, Mike Johnson wrote: 


Hi Kevin,
 
Thx for that tidbit of info,
 
In that file I found the correct syntax, out of Sean's set, the 2 below will 
work,
 
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);
 
But, this is baffling me...
 
This is my scrip
 
Condition: On Queue Change
Action: User Defined
Custom action Preparation Code:
# set new Ticket Owner value
my $ticket = $self-TicketObj;
$ticket-SetStatus(new);
$ticket-SetOwner(Nobody);
 
Based on the above investigation, I know the syntax is correct for the 
SetOwner.  However, the only thing that happens on queue change is the ticket's 
status is set to new.  That shows up in the ticket history.  The SetOwner 
doesn't show up at all, nothing happens.
 
This is the exact same spot Sean got stuck and the thread ended.
 
 
Ken Crocker(thx Ken) provided the above code + 1 line (return 1;) and said his 
is in the cleanup code spot.  If I put that code in there, absolutely nothing 
gets changed in the ticket...
 
Any thoughts anyone?
 
 
 
 
 
Mike Johnson
Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON   P7B 5E1
Phone: 807.766.7331
Email: mike.john...@normed.ca 
Technology assistance: email nosmhelpd...@normed.ca 
Technology Emergency Contact (TEC) Mon-Fri, 8am to 5pm excluding stat holidays: 
Off campus toll free 1-800-461-8777, option 8, or locally either 
(705)-662-7120 or (807)-766-7500


 Kevin Falcone falc...@bestpractical.com ( 
 mailto:falc...@bestpractical.com ) 24/09/2009 5:06 pm 
On Thu, Sep 24, 2009 at 04:02:10PM -0400, Mike Johnson wrote:
I was looking through the list's history.
 
The original email did not get an answer to it.
 
The piece that interests me about this listserv topic(dating back to Aug 
 2007)
 
 
Sean, and myself are trying to set a ticket's owner to nobody on an 
 action...
 
He stated,
 
I've tried:
 
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Id = 10);
$self-TicketObj-SetOwner(Id = 10);
 
None of these has worked and nothing in rt.log indicates any problems.  I 
 have
it set up with debug so I know I'm getting as much info as I can.

If you want as much information as possible, you should check the
return values of SetOwner.  The arguments for the SetOwner method are
documented in Ticket_Overlay.pm.

-kevin

Can anyone tell me which of the above? and what else do I need to set to 
 make this happen on a
specific condition(I'm using On Queue change).
___http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com ( http://wiki.bestpractical.com/ 
)Commercial support: sa...@bestpractical.com 

Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com ( 
http://rtbook.bestpractical.com/ )
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Re: [rt-users] SetStatus and SetOwner scrip question

2009-09-24 Thread Mike Johnson
I was looking through the list's history.
 
The original email did not get an answer to it.
 
The piece that interests me about this listserv topic(dating back to Aug 
2007)
 
 
Sean, and myself are trying to set a ticket's owner to nobody on an action...
 
He stated,
 
I've tried:

$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Id = 10);
$self-TicketObj-SetOwner(Id = 10);

None of these has worked and nothing in rt.log indicates any problems.  I have
it set up with debug so I know I'm getting as much info as I can.
 
Can anyone tell me which of the above? and what else do I need to set to make 
this happen on a specific condition(I'm using On Queue change).
 
Mike Johnson
Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON   P7B 5E1
Phone: 807.766.7331
Email: mike.john...@normed.ca 
Technology assistance: email nosmhelpd...@normed.ca 
Technology Emergency Contact (TEC) Mon-Fri, 8am to 5pm excluding stat holidays: 
Off campus toll free 1-800-461-8777, option 8, or locally either 
(705)-662-7120 or (807)-766-7500
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Re: [rt-users] SetStatus and SetOwner scrip question

2009-09-24 Thread Kevin Falcone
On Thu, Sep 24, 2009 at 04:02:10PM -0400, Mike Johnson wrote:
I was looking through the list's history.
 
The original email did not get an answer to it.
 
The piece that interests me about this listserv topic(dating back to Aug 
 2007)
 
 
Sean, and myself are trying to set a ticket's owner to nobody on an 
 action...
 
He stated,
 
I've tried:
 
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Id = 10);
$self-TicketObj-SetOwner(Id = 10);
 
None of these has worked and nothing in rt.log indicates any problems.  I 
 have
it set up with debug so I know I'm getting as much info as I can.

If you want as much information as possible, you should check the
return values of SetOwner.  The arguments for the SetOwner method are
documented in Ticket_Overlay.pm.

-kevin

Can anyone tell me which of the above? and what else do I need to set to 
 make this happen on a
specific condition(I'm using On Queue change).


pgpP2rEo1bWNZ.pgp
Description: PGP signature
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Re: [rt-users] SetStatus and SetOwner scrip question

2009-09-24 Thread Ken Crocker

Mike,

We use this for when a ticket is moved to another Queue:

# set new Ticket Owner value
my $ticket = $self-TicketObj;
$ticket-SetStatus(new);
$ticket-SetOwner(10, 'Force');
return 1;

The above code is put into the cleanup code. Hope this helps


Kenn
LBNL


On 9/24/2009 1:02 PM, Mike Johnson wrote:

I was looking through the list's history.
 
The original email did not get an answer to it.
 
The piece that interests me about this listserv topic(dating back to 
Aug 2007)
 
 
Sean, and myself are trying to set a ticket's owner to nobody on an 
action...
 
He stated,
 
I've tried:


$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Id = 10);
$self-TicketObj-SetOwner(Id = 10);

None of these has worked and nothing in rt.log indicates any 
problems.  I have

it set up with debug so I know I'm getting as much info as I can.
 
Can anyone tell me which of the above? and what else do I need to set 
to make this happen on a specific condition(I'm using On Queue change).
 
Mike Johnson

Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON   P7B 5E1
Phone: 807.766.7331
Email: mike.john...@normed.ca mailto:mike.john...@normed.ca
Technology assistance: email nosmhelpd...@normed.ca 
mailto:nosmhelpd...@normed.ca
Technology Emergency Contact (TEC) Mon-Fri, 8am to 5pm excluding stat 
holidays:

Off campus toll free 1-800-461-8777, option 8, or locally either
(705)-662-7120 or (807)-766-7500


___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Gene LeDuc

Hi Mathew,

If you have that code in the Cleanup area, make sure you have a return 1; 
in the Prep area (otherwise the Cleanup code doesn't execute).


I'm not sure that you can pass Nobody to the SetOwner method; I think it 
wants an Id rather than a name.  Use $RT::Nobody-Id to get the Id for 
Nobody:

  $self-TicketObj-SetOwner($RT::Nobody-Id);

Regarding which template, it doesn't matter because User Defined actions 
can't access templates.  I always set it to Global:Blank so I don't think 
that it's actually doing anything.


Regards,
Gene

At 08:23 AM 8/14/2007, Mathew Snyder wrote:

RT 3.6.1

Condition: On Queue Change
Action: User Defined
Template: Not sure which one I should be using

I figure that that the Custom action cleanup code should be
$self-TicketObj-SetStatus(new); and $self-TicketObj-SetOwner(Nobody);
but nothing happens.

This is my first attempt at a custom scrip so I don't know what needs to be
done/in place for it to work.  My Custom Condition is blank, my Custom action
preparation code is blank.

Any thoughts?
Mathew
--
Keep up with me and what I'm up to: http://theillien.blogspot.com
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com



--
Gene LeDuc, GSEC
Security Analyst
San Diego State University 


___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Mathew Snyder
I did what you suggested.  It still isn't having an effect.  The owner doesn't
change nor does the status.

Keep up with me and what I'm up to: http://theillien.blogspot.com


Gene LeDuc wrote:
 Hi Mathew,
 
 If you have that code in the Cleanup area, make sure you have a return
 1; in the Prep area (otherwise the Cleanup code doesn't execute).
 
 I'm not sure that you can pass Nobody to the SetOwner method; I think
 it wants an Id rather than a name.  Use $RT::Nobody-Id to get the Id
 for Nobody:
   $self-TicketObj-SetOwner($RT::Nobody-Id);
 
 Regarding which template, it doesn't matter because User Defined actions
 can't access templates.  I always set it to Global:Blank so I don't
 think that it's actually doing anything.
 
 Regards,
 Gene
 
 At 08:23 AM 8/14/2007, Mathew Snyder wrote:
 RT 3.6.1

 Condition: On Queue Change
 Action: User Defined
 Template: Not sure which one I should be using

 I figure that that the Custom action cleanup code should be
 $self-TicketObj-SetStatus(new); and
 $self-TicketObj-SetOwner(Nobody);
 but nothing happens.

 This is my first attempt at a custom scrip so I don't know what needs
 to be
 done/in place for it to work.  My Custom Condition is blank, my Custom
 action
 preparation code is blank.

 Any thoughts?
 Mathew
 -- 
 Keep up with me and what I'm up to: http://theillien.blogspot.com
 ___
 http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

 Community help: http://wiki.bestpractical.com
 Commercial support: [EMAIL PROTECTED]


 Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
 Buy a copy at http://rtbook.bestpractical.com
 
 
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Gene LeDuc
From your first post, I'm guessing that you want the status and owner set 
when a ticket is moved into a specific queue.  Is this correct?


Is your scrip in the incoming queue, the queue that the ticket is being 
moved into?


Is anything being logged in your rt.log file?

At 09:39 AM 8/14/2007, Mathew Snyder wrote:

I did what you suggested.  It still isn't having an effect.  The owner doesn't
change nor does the status.

Keep up with me and what I'm up to: http://theillien.blogspot.com


Gene LeDuc wrote:
 Hi Mathew,

 If you have that code in the Cleanup area, make sure you have a return
 1; in the Prep area (otherwise the Cleanup code doesn't execute).

 I'm not sure that you can pass Nobody to the SetOwner method; I think
 it wants an Id rather than a name.  Use $RT::Nobody-Id to get the Id
 for Nobody:
   $self-TicketObj-SetOwner($RT::Nobody-Id);

 Regarding which template, it doesn't matter because User Defined actions
 can't access templates.  I always set it to Global:Blank so I don't
 think that it's actually doing anything.

 Regards,
 Gene

 At 08:23 AM 8/14/2007, Mathew Snyder wrote:
 RT 3.6.1

 Condition: On Queue Change
 Action: User Defined
 Template: Not sure which one I should be using

 I figure that that the Custom action cleanup code should be
 $self-TicketObj-SetStatus(new); and
 $self-TicketObj-SetOwner(Nobody);
 but nothing happens.

 This is my first attempt at a custom scrip so I don't know what needs
 to be
 done/in place for it to work.  My Custom Condition is blank, my Custom
 action
 preparation code is blank.

 Any thoughts?
 Mathew
 --
 Keep up with me and what I'm up to: http://theillien.blogspot.com
 ___
 http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

 Community help: http://wiki.bestpractical.com
 Commercial support: [EMAIL PROTECTED]


 Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
 Buy a copy at http://rtbook.bestpractical.com





--
Gene LeDuc, GSEC
Security Analyst
San Diego State University 


___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Mathew Snyder
I figured out part of it: Typo was causing problems.  As a result, the status is
now being set to new as I was looking for.  However, the owner is not being
changed.

I'm not seeing any errors in rt.log that would indicate why this is.  I've only
seen the messages telling me that scrips were being prepared and commits were
being made.

Keep up with me and what I'm up to: http://theillien.blogspot.com


Gene LeDuc wrote:
 From your first post, I'm guessing that you want the status and owner
 set when a ticket is moved into a specific queue.  Is this correct?
 
 Is your scrip in the incoming queue, the queue that the ticket is
 being moved into?
 
 Is anything being logged in your rt.log file?
 
 At 09:39 AM 8/14/2007, Mathew Snyder wrote:
 I did what you suggested.  It still isn't having an effect.  The owner
 doesn't
 change nor does the status.

 Keep up with me and what I'm up to: http://theillien.blogspot.com


 Gene LeDuc wrote:
  Hi Mathew,
 
  If you have that code in the Cleanup area, make sure you have a return
  1; in the Prep area (otherwise the Cleanup code doesn't execute).
 
  I'm not sure that you can pass Nobody to the SetOwner method; I think
  it wants an Id rather than a name.  Use $RT::Nobody-Id to get the Id
  for Nobody:
$self-TicketObj-SetOwner($RT::Nobody-Id);
 
  Regarding which template, it doesn't matter because User Defined
 actions
  can't access templates.  I always set it to Global:Blank so I don't
  think that it's actually doing anything.
 
  Regards,
  Gene
 
  At 08:23 AM 8/14/2007, Mathew Snyder wrote:
  RT 3.6.1
 
  Condition: On Queue Change
  Action: User Defined
  Template: Not sure which one I should be using
 
  I figure that that the Custom action cleanup code should be
  $self-TicketObj-SetStatus(new); and
  $self-TicketObj-SetOwner(Nobody);
  but nothing happens.
 
  This is my first attempt at a custom scrip so I don't know what needs
  to be
  done/in place for it to work.  My Custom Condition is blank, my Custom
  action
  preparation code is blank.
 
  Any thoughts?
  Mathew
  --
  Keep up with me and what I'm up to: http://theillien.blogspot.com
  ___
  http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
 
  Community help: http://wiki.bestpractical.com
  Commercial support: [EMAIL PROTECTED]
 
 
  Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
  Buy a copy at http://rtbook.bestpractical.com
 
 
 
 
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Mathew Snyder
I've tried:

$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Id = 10);
$self-TicketObj-SetOwner(Id = 10);

None of these has worked and nothing in rt.log indicates any problems.  I have
it set up with debug so I know I'm getting as much info as I can.

Mathew
Keep up with me and what I'm up to: http://theillien.blogspot.com


Gene LeDuc wrote:
 From your first post, I'm guessing that you want the status and owner
 set when a ticket is moved into a specific queue.  Is this correct?
 
 Is your scrip in the incoming queue, the queue that the ticket is
 being moved into?
 
 Is anything being logged in your rt.log file?
 
 At 09:39 AM 8/14/2007, Mathew Snyder wrote:
 I did what you suggested.  It still isn't having an effect.  The owner
 doesn't
 change nor does the status.

 Keep up with me and what I'm up to: http://theillien.blogspot.com


 Gene LeDuc wrote:
  Hi Mathew,
 
  If you have that code in the Cleanup area, make sure you have a return
  1; in the Prep area (otherwise the Cleanup code doesn't execute).
 
  I'm not sure that you can pass Nobody to the SetOwner method; I think
  it wants an Id rather than a name.  Use $RT::Nobody-Id to get the Id
  for Nobody:
$self-TicketObj-SetOwner($RT::Nobody-Id);
 
  Regarding which template, it doesn't matter because User Defined
 actions
  can't access templates.  I always set it to Global:Blank so I don't
  think that it's actually doing anything.
 
  Regards,
  Gene
 
  At 08:23 AM 8/14/2007, Mathew Snyder wrote:
  RT 3.6.1
 
  Condition: On Queue Change
  Action: User Defined
  Template: Not sure which one I should be using
 
  I figure that that the Custom action cleanup code should be
  $self-TicketObj-SetStatus(new); and
  $self-TicketObj-SetOwner(Nobody);
  but nothing happens.
 
  This is my first attempt at a custom scrip so I don't know what needs
  to be
  done/in place for it to work.  My Custom Condition is blank, my Custom
  action
  preparation code is blank.
 
  Any thoughts?
  Mathew
  --
  Keep up with me and what I'm up to: http://theillien.blogspot.com
  ___
  http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
 
  Community help: http://wiki.bestpractical.com
  Commercial support: [EMAIL PROTECTED]
 
 
  Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
  Buy a copy at http://rtbook.bestpractical.com
 
 
 
 
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Stephen Turner


At Tuesday 8/14/2007 02:14 PM, Mathew Snyder wrote:

I've tried:

$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(Nobody);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(10);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Name = Nobody);
$self-TicketObj-SetOwner(Id = 10);
$self-TicketObj-SetOwner(Id = 10);

None of these has worked and nothing in rt.log indicates any problems.  I have
it set up with debug so I know I'm getting as much info as I can.


Mathew,

You may be running into something that's bitten us before - let's say 
the ticket is currently owned by theillien and you change the 
queue. The scrip will change the owner to Nobody, then the form input 
is processed. RT sees that the owner is Nobody and that the owner 
field on the form is theillien, so it interprets this as a change 
from Nobody to theillien and you end up where you started. Do you 
have any entries in the ticket history showing any ownership changes?


Steve 


___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Mathew Snyder
Stephen Turner wrote:
 
 At Tuesday 8/14/2007 02:14 PM, Mathew Snyder wrote:
 I've tried:

 $self-TicketObj-SetOwner(Nobody);
 $self-TicketObj-SetOwner(Nobody);
 $self-TicketObj-SetOwner(10);
 $self-TicketObj-SetOwner(10);
 $self-TicketObj-SetOwner(Name = Nobody);
 $self-TicketObj-SetOwner(Name = Nobody);
 $self-TicketObj-SetOwner(Id = 10);
 $self-TicketObj-SetOwner(Id = 10);

 None of these has worked and nothing in rt.log indicates any
 problems.  I have
 it set up with debug so I know I'm getting as much info as I can.
 
 Mathew,
 
 You may be running into something that's bitten us before - let's say
 the ticket is currently owned by theillien and you change the queue.
 The scrip will change the owner to Nobody, then the form input is
 processed. RT sees that the owner is Nobody and that the owner field on
 the form is theillien, so it interprets this as a change from Nobody
 to theillien and you end up where you started. Do you have any entries
 in the ticket history showing any ownership changes?
 
 Steve
 

Steve,

No, I'm not seeing that.  Only two actions are being displayed when I move the
ticket:

msnyder - Queue changed from CustomerCare to CCEng
RT_System - Status changed from 'open' to 'new'

Nothing saying Given to ...

Mathew
-- 
Keep up with me and what I'm up to: http://theillien.blogspot.com
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Mathew Snyder
Stephen Turner wrote:
 
 At Tuesday 8/14/2007 02:14 PM, Mathew Snyder wrote:
 I've tried:

 $self-TicketObj-SetOwner(Nobody);
 $self-TicketObj-SetOwner(Nobody);
 $self-TicketObj-SetOwner(10);
 $self-TicketObj-SetOwner(10);
 $self-TicketObj-SetOwner(Name = Nobody);
 $self-TicketObj-SetOwner(Name = Nobody);
 $self-TicketObj-SetOwner(Id = 10);
 $self-TicketObj-SetOwner(Id = 10);

 None of these has worked and nothing in rt.log indicates any
 problems.  I have
 it set up with debug so I know I'm getting as much info as I can.
 
 Mathew,
 
 You may be running into something that's bitten us before - let's say
 the ticket is currently owned by theillien and you change the queue.
 The scrip will change the owner to Nobody, then the form input is
 processed. RT sees that the owner is Nobody and that the owner field on
 the form is theillien, so it interprets this as a change from Nobody
 to theillien and you end up where you started. Do you have any entries
 in the ticket history showing any ownership changes?
 
 Steve
 
I take it back.  It would appear you are correct.  I set up the scrip to log
it's actions on this particular line of code and I'm getting:

[debug]: set owner: 814382: Owner changed from msnyder to Nobody ((eval 510):4)

However, there is no indication in the ticket that this is happening nor that it
was returned to the original value.  So how can I get around this?

Mathew
-- 
Keep up with me and what I'm up to: http://theillien.blogspot.com
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Stephen Turner

At Tuesday 8/14/2007 02:41 PM, Mathew Snyder wrote:


I take it back.  It would appear you are correct.  I set up the scrip to log
it's actions on this particular line of code and I'm getting:

[debug]: set owner: 814382: Owner changed from msnyder to Nobody 
((eval 510):4)


However, there is no indication in the ticket that this is happening 
nor that it

was returned to the original value.  So how can I get around this?


Unfortunately we haven't found a way round this problem. What's odd 
about your situation though is that I'd expect to see history entries 
recording the two owner change transactions. Sorry I can't be more helpful...


Steve 


___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Mathew Snyder
Stephen Turner wrote:
 At Tuesday 8/14/2007 02:41 PM, Mathew Snyder wrote:
 
 I take it back.  It would appear you are correct.  I set up the scrip
 to log
 it's actions on this particular line of code and I'm getting:

 [debug]: set owner: 814382: Owner changed from msnyder to Nobody
 ((eval 510):4)

 However, there is no indication in the ticket that this is happening
 nor that it
 was returned to the original value.  So how can I get around this?
 
 Unfortunately we haven't found a way round this problem. What's odd
 about your situation though is that I'd expect to see history entries
 recording the two owner change transactions. Sorry I can't be more
 helpful...
 
 Steve
 

Well that sucks. :(

Mathew
-- 
Keep up with me and what I'm up to: http://theillien.blogspot.com
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Robert Long
Have you tried moving the scrip to from TransactionCreate to
TransactionBatch? You may have to enable it in your RT_SiteConfig..

.r'

 
Mathew Snyder wrote:
 Stephen Turner wrote:
   
 At Tuesday 8/14/2007 02:41 PM, Mathew Snyder wrote:
 
 I take it back.  It would appear you are correct.  I set up the scrip
 to log
 it's actions on this particular line of code and I'm getting:

 [debug]: set owner: 814382: Owner changed from msnyder to Nobody
 ((eval 510):4)

 However, there is no indication in the ticket that this is happening
 nor that it
 was returned to the original value.  So how can I get around this?
   
 Unfortunately we haven't found a way round this problem. What's odd
 about your situation though is that I'd expect to see history entries
 recording the two owner change transactions. Sorry I can't be more
 helpful...

 Steve

 

 Well that sucks. :(

 Mathew
   

___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Mathew Snyder
Robert Long wrote:
 Have you tried moving the scrip to from TransactionCreate to
 TransactionBatch? You may have to enable it in your RT_SiteConfig..
 
 .r'
 
  
 Mathew Snyder wrote:
 Stephen Turner wrote:
   
 At Tuesday 8/14/2007 02:41 PM, Mathew Snyder wrote:
 
 I take it back.  It would appear you are correct.  I set up the scrip
 to log
 it's actions on this particular line of code and I'm getting:

 [debug]: set owner: 814382: Owner changed from msnyder to Nobody
 ((eval 510):4)

 However, there is no indication in the ticket that this is happening
 nor that it
 was returned to the original value.  So how can I get around this?
   
 Unfortunately we haven't found a way round this problem. What's odd
 about your situation though is that I'd expect to see history entries
 recording the two owner change transactions. Sorry I can't be more
 helpful...

 Steve

 
 Well that sucks. :(

 Mathew
   
 
 

There is no TransactionCreate or TransactionBatch in my RT_SiteConfig.  All I
have that is related to transactions is
# Backward compatability setting. Add/Delete Link used to record one
# transaction and run one scrip. Set this value to 1 if you want
# only one of the link transactions to have scrips run.
Set($LinkTransactionsRun1Scrip , 0);

Mathew
-- 
Keep up with me and what I'm up to: http://theillien.blogspot.com
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


RE: [rt-users] SetStatus and SetOwner scrip question

2007-08-14 Thread Edge, Sean
Mathew,
I found this in the wiki, hope it helps.
http://wiki.bestpractical.com/view/TransactionBatchStage

-Sean 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mathew
Snyder
Sent: Tuesday, August 14, 2007 3:03 PM
To: Robert Long
Cc: Stephen Turner; RT Users
Subject: Re: [rt-users] SetStatus and SetOwner scrip question

Robert Long wrote:
 Have you tried moving the scrip to from TransactionCreate to 
 TransactionBatch? You may have to enable it in your RT_SiteConfig..
 
 .r'
 
  
 Mathew Snyder wrote:
 Stephen Turner wrote:
   
 At Tuesday 8/14/2007 02:41 PM, Mathew Snyder wrote:
 
 I take it back.  It would appear you are correct.  I set up the 
 scrip to log it's actions on this particular line of code and I'm 
 getting:

 [debug]: set owner: 814382: Owner changed from msnyder to Nobody 
 ((eval 510):4)

 However, there is no indication in the ticket that this is 
 happening nor that it was returned to the original value.  So how 
 can I get around this?
   
 Unfortunately we haven't found a way round this problem. What's odd 
 about your situation though is that I'd expect to see history 
 entries recording the two owner change transactions. Sorry I can't 
 be more helpful...

 Steve

 
 Well that sucks. :(

 Mathew
   
 
 

There is no TransactionCreate or TransactionBatch in my RT_SiteConfig.
All I have that is related to transactions is # Backward compatability
setting. Add/Delete Link used to record one # transaction and run one
scrip. Set this value to 1 if you want # only one of the link
transactions to have scrips run.
Set($LinkTransactionsRun1Scrip , 0);

Mathew
--
Keep up with me and what I'm up to: http://theillien.blogspot.com
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com Commercial support:
[EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com



This email (including any attachments) is for its intended-recipient's
use only. This email may contain information that is confidential or
privileged.  If you received this email in error, please immediately
advise the sender by replying to this email and then delete this message
from your system.  For further information and disclaimers that apply to
this email, see [http://www.viacom.com/email_disclaimer.jhtml].
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com