Re: [rt-users] rt-validator does not delete osbolete ObjectCustomFieldValue records

2013-09-01 Thread David Moreau Simard
Hi,

Does these commits make sense to you ? It seems to work well.

https://github.com/bestpractical/rt/pull/64

David Moreau Simard

On 2013-08-30, at 9:37 AM, Ruslan Zakirov 
r...@bestpractical.commailto:r...@bestpractical.com wrote:

Hi,

Do you care enough to send patch or git pull request? If not then file a 
feature request on 
http://issues.bestpractical.comhttp://issues.bestpractical.com/ .


On Thu, Aug 29, 2013 at 5:18 PM, David Moreau Simard 
dmsim...@iweb.commailto:dmsim...@iweb.com wrote:
Hi,

We're trying to do a large cleanup of our database. There are a lot of obsolete 
ObjectCustomFieldValue records that are related to deleted tickets.
I would expect rt-validator to both delete related Transactions AND The 
ObjectCustomFieldValue records themselves.

This is not happening, although it does detect issues - for example:
===
Record #33716942 in ObjectCustomFieldValues references a nonexistent record in 
Tickets
ObjectId = '6417200' = id
===
Record #1 in ObjectCustomFieldValues references a nonexistent record in 
Transactions
ObjectId = '8651463' = id
===

After spending a lot on time on this, I came to realize that the sub in 
rt-validator for custom fields integrity does not use delete_record at all.

Example that uses delete_record:
===
push @CHECKS, 'Tickets - Role Groups' = sub {
# XXX: we check only that there is at least one group for a queue
# from queue to group
check_integrity(
'Tickets', 'id' = 'Groups', 'Instance',
join_condition   = 't.Domain = ?',
bind_values = [ 'RT::Ticket-Role' ],
);
# from group to ticket
check_integrity(
'Groups', 'Instance' = 'Tickets', 'id',
condition   = 's.Domain = ?',
bind_values = [ 'RT::Ticket-Role' ],
action = sub {
my $id = shift;
return unless prompt(
'Delete', Found a role group of a nonexistent ticket.
);

delete_record( 'Groups', $id );
},
);
};
===

Now, custom field checks are done this way, without delete_record:
===
push @CHECKS, 'CustomFields and friends' = sub {
#XXX: ObjectCustomFields needs more love
check_integrity(
'CustomFieldValues', 'CustomField' = 'CustomFields', 'id',
);
check_integrity(
'ObjectCustomFieldValues', 'CustomField' = 'CustomFields', 'id',
);
foreach my $model ( @models ) {
check_integrity(
'ObjectCustomFieldValues', 'ObjectId' = m2t($model), 'id',
condition   = 's.ObjectType = ?',
bind_values = [ RT::$model ],
);
}
};
===

I'm not entirely safe with putting a delete_record somewhere in there.

Can someone chime in about what would be my best course of action ?

Thanks,

David Moreau Simard



--
Best regards, Ruslan.



[rt-users] rt-validator does not delete osbolete ObjectCustomFieldValue records

2013-08-29 Thread David Moreau Simard
Hi,

We're trying to do a large cleanup of our database. There are a lot of obsolete 
ObjectCustomFieldValue records that are related to deleted tickets.
I would expect rt-validator to both delete related Transactions AND The 
ObjectCustomFieldValue records themselves.

This is not happening, although it does detect issues - for example:
===
Record #33716942 in ObjectCustomFieldValues references a nonexistent record in 
Tickets
ObjectId = '6417200' = id
===
Record #1 in ObjectCustomFieldValues references a nonexistent record in 
Transactions
ObjectId = '8651463' = id
===

After spending a lot on time on this, I came to realize that the sub in 
rt-validator for custom fields integrity does not use delete_record at all.

Example that uses delete_record:
===
push @CHECKS, 'Tickets - Role Groups' = sub {
# XXX: we check only that there is at least one group for a queue
# from queue to group
check_integrity(
'Tickets', 'id' = 'Groups', 'Instance',
join_condition   = 't.Domain = ?',
bind_values = [ 'RT::Ticket-Role' ],
);
# from group to ticket
check_integrity(
'Groups', 'Instance' = 'Tickets', 'id',
condition   = 's.Domain = ?',
bind_values = [ 'RT::Ticket-Role' ],
action = sub {
my $id = shift;
return unless prompt(
'Delete', Found a role group of a nonexistent ticket.
);

delete_record( 'Groups', $id );
},
);
};
===

Now, custom field checks are done this way, without delete_record:
===
push @CHECKS, 'CustomFields and friends' = sub {
#XXX: ObjectCustomFields needs more love
check_integrity(
'CustomFieldValues', 'CustomField' = 'CustomFields', 'id',
);
check_integrity(
'ObjectCustomFieldValues', 'CustomField' = 'CustomFields', 'id',
);
foreach my $model ( @models ) {
check_integrity(
'ObjectCustomFieldValues', 'ObjectId' = m2t($model), 'id',
condition   = 's.ObjectType = ?',
bind_values = [ RT::$model ],
);
}
};
===

I'm not entirely safe with putting a delete_record somewhere in there.

Can someone chime in about what would be my best course of action ?

Thanks,

David Moreau Simard

Re: [rt-users] RT Bug?

2012-11-21 Thread David Moreau Simard

Hey there,

Just wanted to confirm that it does seem to be a regression.
https://github.com/bestpractical/rt/commits/3.8-trunk/lib/RT/I18N.pm
https://github.com/bestpractical/rt/commit/ccafbd233e4f50bd8ef1889949e91dc6190f495b

That eval seems to be necessary to have a Fallback encoding if an 
e-mail is received with an encoding that doesn't exist/isn't recognized.
We've tested the eval inside the 3.8.15 I18N.pm and were able to receive 
e-mails if they're a non-standard encoding again.


For the time being, and I know this is not ideal, we've reverted only 
I18N.pm to our previous version from 3.8.8 and everything works well again.


Feel free to let me know if you have any questions !

*David Moreau Simard*
/   IT Specialist/

On 12-11-14 9:49 AM, Kevin Falcone wrote:

On Wed, Nov 14, 2012 at 08:51:06AM -0500, David Moreau Simard wrote:

Chiming in to say that we're also having this issue on RT version 3.8.15.
This other thread also references the issue:
http://www.gossamer-threads.com/lists/rt/users/108219

Should we expect a fix on the 3.8.x branch as well ? It's a rather
inconvenient bug considering it wasn't present before our upgrade
from 3.8.8.

RT 3.8 is only getting critical and security fixes (see paragraph 3 of
this)

http://blog.bestpractical.com/2012/08/release-scheduling.html

If this is really a regression from 3.8.8 then it's possible we'll
make a 3.8.16 release, but you're the first person to claim a
regression.

-kevin



We're hiring! http://bestpractical.com/jobs



We're hiring! http://bestpractical.com/jobs


Re: [rt-users] RT Bug?

2012-11-15 Thread David Moreau Simard
What kind of information would you need to further confirm the issue on 
the 3.8.x branch ?


I'd gladly pass along the information.

Thanks !

*David Moreau Simard*/
   IT Specialist/

On 12-11-14 9:49 AM, Kevin Falcone wrote:

On Wed, Nov 14, 2012 at 08:51:06AM -0500, David Moreau Simard wrote:

Chiming in to say that we're also having this issue on RT version 3.8.15.
This other thread also references the issue:
http://www.gossamer-threads.com/lists/rt/users/108219

Should we expect a fix on the 3.8.x branch as well ? It's a rather
inconvenient bug considering it wasn't present before our upgrade
from 3.8.8.

RT 3.8 is only getting critical and security fixes (see paragraph 3 of
this)

http://blog.bestpractical.com/2012/08/release-scheduling.html

If this is really a regression from 3.8.8 then it's possible we'll
make a 3.8.16 release, but you're the first person to claim a
regression.

-kevin



We're hiring! http://bestpractical.com/jobs



We're hiring! http://bestpractical.com/jobs


Re: [rt-users] MySQL Scaling for a large instance

2012-03-16 Thread David Moreau Simard

Hi !

Do you know of any successful MySQL proxy implentations with RT ?

It is indeed one of the solutions we had been thinking of but it does 
not have a release deemed stable at this time, still in beta.


Thanks,
--
*David Moreau Simard*
/Spécialiste TI //
   IT Specialist/ http://iweb.com




Ruslan Zakirov mailto:r...@bestpractical.com
13 March, 2012 6:53 PM
On Tue, Mar 13, 2012 at 20:56, David Moreau Simarddmsim...@iweb.com  wrote:

Hi,

Our RT instance is rather large (  5 million tickets) and I wondered if any
users have had to deal with a RT database this size and if so, how they
scaled their infrastructure as a result.

Right now, the web portion is hosted on a cluster and really, this part
doesn't worry me at all.
I am really curious what are our options to get the best possible database
performance at this point.

A thought we had was to split reads and writes since we have significantly
higher demand for read operations and they can be scaled/load-balanced with
relative ease.
Has anyone attempted to do this ? RT doesn't seem to be able to do this out
of the box.


It wouldn't be too hard to route writes to master and reads to
replicas, but replication is async in mysql. Only mysql 5.5 supports
semisync replication. Probably solutions like mysql proxy can


Do you otherwise have other recommendations ?


You can move sessions out of mysql. There is a pull request and/or
branch that makes it possible to configure sessions to use other
storages (mostly modern NoSQL DBs) right in the config without
patching code.

There are a few improvements in 4.2 branches that lower number of
reads per request by caching some answers related to user's
preferences. It's especially effective when users have no preferences.

If you're still on 3.x then upgrade to 4.0 would be a win for sure. We
greatly lowered number of queries per page.

Advanced web server setup (see RT-Extension-Nginx for ideas or to
replace) can lower number of requests to RT's code. Any additional
request to RT (for image, css, js) still does a few SQL queries, not
that many like requests for html, but still.

There are a lot of tiny things that can be done to lower pressure on DB.


Thanks !
--
*David Moreau Simard*
/IT Specialist/




David Moreau Simard mailto:dmsim...@iweb.com
13 March, 2012 12:56 PM
Hi,

Our RT instance is rather large ( 5 million tickets) and I wondered 
if any users have had to deal with a RT database this size and if so, 
how they scaled their infrastructure as a result.


Right now, the web portion is hosted on a cluster and really, this 
part doesn't worry me at all.
I am really curious what are our options to get the best possible 
database performance at this point.


A thought we had was to split reads and writes since we have 
significantly higher demand for read operations and they can be 
scaled/load-balanced with relative ease.
Has anyone attempted to do this ? RT doesn't seem to be able to do 
this out of the box.


Do you otherwise have other recommendations ?

Thanks !


[rt-users] MySQL Scaling for a large instance

2012-03-13 Thread David Moreau Simard

Hi,

Our RT instance is rather large ( 5 million tickets) and I wondered if 
any users have had to deal with a RT database this size and if so, how 
they scaled their infrastructure as a result.


Right now, the web portion is hosted on a cluster and really, this part 
doesn't worry me at all.
I am really curious what are our options to get the best possible 
database performance at this point.


A thought we had was to split reads and writes since we have 
significantly higher demand for read operations and they can be 
scaled/load-balanced with relative ease.
Has anyone attempted to do this ? RT doesn't seem to be able to do this 
out of the box.


Do you otherwise have other recommendations ?

Thanks !
--
*David Moreau Simard*
/IT Specialist/



Re: [rt-users] RT-Extention-QueueDeactivatedScrips

2011-12-28 Thread David Moreau Simard

Hi there,

So, I've finally got the chance to grant some time at trying this out. 
Before going ahead, I just wanted to say that I've never actually used 
this plugin so I am not certain what is the expected behavior.
However, this seems like it would be really useful in reducing the 
amount of maintenance involved in working with identical scrips in 
different queues.


Here is how I've set it up on my 4.0.4 environment:
===
wget 
https://github.com/tbrumm/RT-Extension-QueueDeactivatedScrips/zipball/master

unzip master
cd tbrumm-RT-Extension-QueueDeactivatedScrips-54c7982/
perl Makefile.PL
make
make install
make initdb

rm -rf /opt/rt4/local/plugins/RT-Extension-QueueDeactivatedScrips/lib/
rm -rf /opt/rt4/local/plugins/RT-Extension-QueueDeactivatedScrips/html/

tar -xvf deactivate_scrips_rt402.tar
cd patch/rt_local
mv * /opt/rt4/local/plugins/RT-Extension-QueueDeactivatedScrips/
===

In RT_SiteConfig.pm: Set(@Plugins, 
qw(RT::Extension::QueueDeactivatedScrips));

Restarted Apache.

Now, when looking at Global Scrips, I have this screen. Not sure if this 
is where it should be showing - this should be when looking at a queue's 
scrips, no ?

http://i.imgur.com/Fp37v.png

Looking at a Queue's scrips shows the default version of Scrips.html, 
not one I would expect (the version that shows in the global scrips 
section).
Therefore, when looking at a Queue, I do not have the ability to 
deactivate a global scrip.


I've tried clearing mason's cache and copying the plugin files directly 
to the local folder instead of inside the plugin folder. No go.


Am I doing something wrong ?

I'm also thinking it could be nice that, instead of going inside a queue 
to deactivate a global scrip, you could go inside a global scrip and see 
a list of queues it is enabled on and change activation parameters there.

But, that's entirely another extension I would think!

*David Moreau Simard*


On 11-12-05 4:41 AM, Givano wrote:

Hi,

here is the diff patch and full files of the extension for RT4.0.2. 
For SQL table use the SQL scripts from Thorstens extension on the 
github https://github.com/tbrumm/RT-Extension-QueueDeactivatedScrips. 
This modifications are fully based on Thorstens extension for RT3.8.


If you need some help in setting up the extension for your RT please ask.

BR, Ivan

PS: @David: would be really interesting to hear if it also works with 
4.0.4.



2011/12/2 David Moreau Simard dmsim...@iweb.com 
mailto:dmsim...@iweb.com


I, for one, would be highly interested in trying the patch out.

I have a 4.0.4 development environment on which I could test it on
- I would report back with compatibility details.

- David

On 11-12-02 9:10 AM, Givano wrote:

Hi guys,

if it's still interesting, I have done the patch for rt 4.0.2 and
it works fine for me. Only three files need to be modified two
html and one lib. If you want I can send you diffs or the files
for rt4.0.2. I dont know if it will work with 4.0.4.

BR, Ivan

2011/10/6 Ruslan Zakirov r...@bestpractical.com
mailto:r...@bestpractical.com

Hi,

On Thu, Oct 6, 2011 at 7:25 PM, Randy Black
randy.bl...@buckle.com mailto:randy.bl...@buckle.com wrote:
 Know of anyone working on the port?


I don't know. It's on github and there is no forks of the
project.
Torsten packaged the extension, probably newer version depends on
patches people would send and/or on his upgrade schedule.


 -Original Message-
 From: ruslan.zaki...@gmail.com
mailto:ruslan.zaki...@gmail.com
[mailto:ruslan.zaki...@gmail.com
mailto:ruslan.zaki...@gmail.com] On Behalf Of Ruslan Zakirov
 Sent: Thursday, October 06, 2011 12:24 PM
 To: Randy Black
 Cc: rt-users@lists.bestpractical.com
mailto:rt-users@lists.bestpractical.com
 Subject: Re: [rt-users] RT-Extention-QueueDeactivatedScrips

 Hi,

 File that couldn't be found was deleted between RT3 and
RT4. What
 means that extension has not been ported over RT4.

 On Thu, Oct 6, 2011 at 4:45 PM, Randy Black
randy.bl...@buckle.com mailto:randy.bl...@buckle.com wrote:
 Does anyone use this extension and have it working in a
production 4.0.2
 instance of RT?

 I have it installed, but when selecting a queue and then
selecting ‘scrips 
 select’ from the menu, I get “could not find component for
path
 ‘/Admin/Elements/QueueTabs’”

 Looking through the doc, the wiki and google, produced
nothing.

 Thanks,

 Randy

 
 RT Training Sessions
(http://bestpractical.com/services/training.html)
 *  San Francisco, CA, USA — October 18  19, 2011
 *  Washington DC, USA — October 31  November 1, 2011

Re: [rt-users] RT-Extention-QueueDeactivatedScrips

2011-12-28 Thread David Moreau Simard
Just tested the same procedure under a fresh 4.0.2 install I've made and 
it reproduced the same results.


*David Moreau Simard*


On 11-12-28 12:10 PM, David Moreau Simard wrote:

Hi there,

So, I've finally got the chance to grant some time at trying this out. 
Before going ahead, I just wanted to say that I've never actually used 
this plugin so I am not certain what is the expected behavior.
However, this seems like it would be really useful in reducing the 
amount of maintenance involved in working with identical scrips in 
different queues.


Here is how I've set it up on my 4.0.4 environment:
===
wget 
https://github.com/tbrumm/RT-Extension-QueueDeactivatedScrips/zipball/master

unzip master
cd tbrumm-RT-Extension-QueueDeactivatedScrips-54c7982/
perl Makefile.PL
make
make install
make initdb

rm -rf /opt/rt4/local/plugins/RT-Extension-QueueDeactivatedScrips/lib/
rm -rf /opt/rt4/local/plugins/RT-Extension-QueueDeactivatedScrips/html/

tar -xvf deactivate_scrips_rt402.tar
cd patch/rt_local
mv * /opt/rt4/local/plugins/RT-Extension-QueueDeactivatedScrips/
===

In RT_SiteConfig.pm: Set(@Plugins, 
qw(RT::Extension::QueueDeactivatedScrips));

Restarted Apache.

Now, when looking at Global Scrips, I have this screen. Not sure if 
this is where it should be showing - this should be when looking at a 
queue's scrips, no ?

http://i.imgur.com/Fp37v.png

Looking at a Queue's scrips shows the default version of Scrips.html, 
not one I would expect (the version that shows in the global scrips 
section).
Therefore, when looking at a Queue, I do not have the ability to 
deactivate a global scrip.


I've tried clearing mason's cache and copying the plugin files 
directly to the local folder instead of inside the plugin folder. No go.


Am I doing something wrong ?

I'm also thinking it could be nice that, instead of going inside a 
queue to deactivate a global scrip, you could go inside a global scrip 
and see a list of queues it is enabled on and change activation 
parameters there.

But, that's entirely another extension I would think!

*David Moreau Simard*


On 11-12-05 4:41 AM, Givano wrote:

Hi,

here is the diff patch and full files of the extension for RT4.0.2. 
For SQL table use the SQL scripts from Thorstens extension on the 
github https://github.com/tbrumm/RT-Extension-QueueDeactivatedScrips. 
This modifications are fully based on Thorstens extension for RT3.8.


If you need some help in setting up the extension for your RT please 
ask.


BR, Ivan

PS: @David: would be really interesting to hear if it also works with 
4.0.4.



2011/12/2 David Moreau Simard dmsim...@iweb.com 
mailto:dmsim...@iweb.com


I, for one, would be highly interested in trying the patch out.

I have a 4.0.4 development environment on which I could test it on
- I would report back with compatibility details.

- David

On 11-12-02 9:10 AM, Givano wrote:

Hi guys,

if it's still interesting, I have done the patch for rt 4.0.2 and
it works fine for me. Only three files need to be modified two
html and one lib. If you want I can send you diffs or the files
for rt4.0.2. I dont know if it will work with 4.0.4.

BR, Ivan

2011/10/6 Ruslan Zakirov r...@bestpractical.com
mailto:r...@bestpractical.com

Hi,

On Thu, Oct 6, 2011 at 7:25 PM, Randy Black
randy.bl...@buckle.com mailto:randy.bl...@buckle.com wrote:
 Know of anyone working on the port?


I don't know. It's on github and there is no forks of the
project.
Torsten packaged the extension, probably newer version 
depends on

patches people would send and/or on his upgrade schedule.


 -Original Message-
 From: ruslan.zaki...@gmail.com
mailto:ruslan.zaki...@gmail.com
[mailto:ruslan.zaki...@gmail.com
mailto:ruslan.zaki...@gmail.com] On Behalf Of Ruslan Zakirov
 Sent: Thursday, October 06, 2011 12:24 PM
 To: Randy Black
 Cc: rt-users@lists.bestpractical.com
mailto:rt-users@lists.bestpractical.com
 Subject: Re: [rt-users] RT-Extention-QueueDeactivatedScrips

 Hi,

 File that couldn't be found was deleted between RT3 and
RT4. What
 means that extension has not been ported over RT4.

 On Thu, Oct 6, 2011 at 4:45 PM, Randy Black
randy.bl...@buckle.com mailto:randy.bl...@buckle.com wrote:
 Does anyone use this extension and have it working in a
production 4.0.2
 instance of RT?

 I have it installed, but when selecting a queue and then
selecting ‘scrips 
 select’ from the menu, I get “could not find component for
path
 ‘/Admin/Elements/QueueTabs’”

 Looking through the doc, the wiki and google, produced
nothing.

 Thanks,

 Randy

 
 RT Training Sessions
(http://bestpractical.com/services/training.html)
 *  San Francisco, CA, USA — October 18  19, 2011
 *  Washington DC, USA — October 31  November 1, 2011
 *  Barcelona, Spain — November 28  29, 2011




 --
 Best regards, Ruslan.




--
Best regards, Ruslan

Re: [rt-users] RT-Extention-QueueDeactivatedScrips

2011-12-28 Thread David Moreau Simard

Okay, I've figured it out what was the issue.
In the patch you provided, the file hierarchy isn't the same as the one 
I have.


If I look at /opt/rt4/share/html, I have the following:
drwxr-xr-x 10 root bin  4096 Dec 28 12:24 Admin
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Approvals
drwxr-xr-x  4 root bin  4096 Dec 28 12:24 Articles
-rw-r--r--  1 root bin  2263 Dec 28 12:24 autohandler
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Dashboards
-rw-r--r--  1 root bin  2285 Dec 28 12:24 dhandler
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Download
drwxr-xr-x 15 root bin  4096 Dec 28 12:24 Elements
drwxr-xr-x  4 root bin  4096 Dec 28 12:24 Helpers
-rw-r--r--  1 root bin  5158 Dec 28 12:24 index.html
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Install
-rw-r--r--  1 root bin  2188 Dec 28 12:24 l
drwxr-xr-x  5 root bin  4096 Dec 28 12:24 m
drwxr-xr-x  9 root bin  4096 Dec 28 12:24 NoAuth
drwxr-xr-x  2 root bin  4096 Dec 28 12:24 Prefs
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 REST
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Search
drwxr-xr-x  5 root bin  4096 Dec 28 12:24 SelfService
drwxr-xr-x  5 root bin  4096 Dec 28 12:24 Ticket
drwxr-xr-x  2 root bin  4096 Dec 28 12:24 Tools
drwxr-xr-x  2 root bin  4096 Dec 28 12:24 User
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Widgets

Now, in the rt_local folder of the patch, the html folder looks like this:
drwxrwxrwx 3 root root 4096 Dec  5 03:49 Admin
drwxrwxrwx 2 root root 4096 Dec  5 03:50 Queues

Notice the Queues folder ? I moved it inside Admin - just like in the 
default hierarchy:

# ls -al /opt/rt4/share/html/Admin/
total 48
drwxr-xr-x 10 root bin 4096 Dec 28 12:24 .
drwxr-xr-x 20 root bin 4096 Dec 28 12:24 ..
drwxr-xr-x  4 root bin 4096 Dec 28 12:24 Articles
-rw-r--r--  1 root bin 2213 Dec 28 12:24 autohandler
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 CustomFields
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Elements
drwxr-xr-x  3 root bin 4096 Dec 28 12:24 Global
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Groups
-rw-r--r--  1 root bin 2268 Dec 28 12:24 index.html
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Queues
drwxr-xr-x  3 root bin 4096 Dec 28 12:24 Tools
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Users

I now get the global scrip activation toggles inside the queue scrips 
configuration.
I'm now testing to see if I am able to get the expected behavior from my 
global scrips.


I've created a dummy global scrip which re-opens a ticket if the status 
is changed. If I change the status to stalled, it resets the ticket's 
status to open.
Now, I've tried deactivating the scrip both through the global section 
and the queue section but it keeps going.


Trying to figure out what is the issue and I will report back !

*David Moreau Simard*


On 11-12-28 12:35 PM, David Moreau Simard wrote:
Just tested the same procedure under a fresh 4.0.2 install I've made 
and it reproduced the same results.


*David Moreau Simard*


On 11-12-28 12:10 PM, David Moreau Simard wrote:

Hi there,

So, I've finally got the chance to grant some time at trying this 
out. Before going ahead, I just wanted to say that I've never 
actually used this plugin so I am not certain what is the expected 
behavior.
However, this seems like it would be really useful in reducing the 
amount of maintenance involved in working with identical scrips in 
different queues.


Here is how I've set it up on my 4.0.4 environment:
===
wget 
https://github.com/tbrumm/RT-Extension-QueueDeactivatedScrips/zipball/master

unzip master
cd tbrumm-RT-Extension-QueueDeactivatedScrips-54c7982/
perl Makefile.PL
make
make install
make initdb

rm -rf /opt/rt4/local/plugins/RT-Extension-QueueDeactivatedScrips/lib/
rm -rf /opt/rt4/local/plugins/RT-Extension-QueueDeactivatedScrips/html/

tar -xvf deactivate_scrips_rt402.tar
cd patch/rt_local
mv * /opt/rt4/local/plugins/RT-Extension-QueueDeactivatedScrips/
===

In RT_SiteConfig.pm: Set(@Plugins, 
qw(RT::Extension::QueueDeactivatedScrips));

Restarted Apache.

Now, when looking at Global Scrips, I have this screen. Not sure if 
this is where it should be showing - this should be when looking at a 
queue's scrips, no ?

http://i.imgur.com/Fp37v.png

Looking at a Queue's scrips shows the default version of Scrips.html, 
not one I would expect (the version that shows in the global scrips 
section).
Therefore, when looking at a Queue, I do not have the ability to 
deactivate a global scrip.


I've tried clearing mason's cache and copying the plugin files 
directly to the local folder instead of inside the plugin folder. No go.


Am I doing something wrong ?

I'm also thinking it could be nice that, instead of going inside a 
queue to deactivate a global scrip, you could go inside a global 
scrip and see a list of queues it is enabled on and change activation 
parameters there.

But, that's entirely another extension I would think!

*David Moreau Simard*


RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012


Re: [rt-users] RT-Extention-QueueDeactivatedScrips

2011-12-28 Thread David Moreau Simard

Okay, I've managed to make it work.

In the patch, there is a file Scrip_Overlay.pm - now, I've renamed this 
file to Scrip.pm since this is the file that it is meant to extend.
After doing some tests, I could not get RT to use the extended Scrip.pm 
- maybe you could provide some insight on that.


However, when I placed the extended Scrip.pm into local/lib/RT, scrip 
activation and deactivation worked as expected.


Any ideas ?

*David Moreau Simard*


On 11-12-28 2:17 PM, David Moreau Simard wrote:

Okay, I've figured it out what was the issue.
In the patch you provided, the file hierarchy isn't the same as the 
one I have.


If I look at /opt/rt4/share/html, I have the following:
drwxr-xr-x 10 root bin  4096 Dec 28 12:24 Admin
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Approvals
drwxr-xr-x  4 root bin  4096 Dec 28 12:24 Articles
-rw-r--r--  1 root bin  2263 Dec 28 12:24 autohandler
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Dashboards
-rw-r--r--  1 root bin  2285 Dec 28 12:24 dhandler
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Download
drwxr-xr-x 15 root bin  4096 Dec 28 12:24 Elements
drwxr-xr-x  4 root bin  4096 Dec 28 12:24 Helpers
-rw-r--r--  1 root bin  5158 Dec 28 12:24 index.html
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Install
-rw-r--r--  1 root bin  2188 Dec 28 12:24 l
drwxr-xr-x  5 root bin  4096 Dec 28 12:24 m
drwxr-xr-x  9 root bin  4096 Dec 28 12:24 NoAuth
drwxr-xr-x  2 root bin  4096 Dec 28 12:24 Prefs
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 REST
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Search
drwxr-xr-x  5 root bin  4096 Dec 28 12:24 SelfService
drwxr-xr-x  5 root bin  4096 Dec 28 12:24 Ticket
drwxr-xr-x  2 root bin  4096 Dec 28 12:24 Tools
drwxr-xr-x  2 root bin  4096 Dec 28 12:24 User
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Widgets

Now, in the rt_local folder of the patch, the html folder looks like 
this:

drwxrwxrwx 3 root root 4096 Dec  5 03:49 Admin
drwxrwxrwx 2 root root 4096 Dec  5 03:50 Queues

Notice the Queues folder ? I moved it inside Admin - just like in the 
default hierarchy:

# ls -al /opt/rt4/share/html/Admin/
total 48
drwxr-xr-x 10 root bin 4096 Dec 28 12:24 .
drwxr-xr-x 20 root bin 4096 Dec 28 12:24 ..
drwxr-xr-x  4 root bin 4096 Dec 28 12:24 Articles
-rw-r--r--  1 root bin 2213 Dec 28 12:24 autohandler
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 CustomFields
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Elements
drwxr-xr-x  3 root bin 4096 Dec 28 12:24 Global
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Groups
-rw-r--r--  1 root bin 2268 Dec 28 12:24 index.html
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Queues
drwxr-xr-x  3 root bin 4096 Dec 28 12:24 Tools
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Users

I now get the global scrip activation toggles inside the queue scrips 
configuration.
I'm now testing to see if I am able to get the expected behavior from 
my global scrips.


I've created a dummy global scrip which re-opens a ticket if the 
status is changed. If I change the status to stalled, it resets the 
ticket's status to open.
Now, I've tried deactivating the scrip both through the global section 
and the queue section but it keeps going.


Trying to figure out what is the issue and I will report back !

*David Moreau Simard*


RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012


Re: [rt-users] RT-Extention-QueueDeactivatedScrips

2011-12-28 Thread David Moreau Simard
I've made an updated version available as a forked project on Github: 
https://github.com/dmsimard/RT-Extension-QueueDeactivatedScrips


Feel free to use it, I will surely update it in the near future.

*David Moreau Simard*


On 11-12-28 4:27 PM, David Moreau Simard wrote:

Okay, I've managed to make it work.

In the patch, there is a file Scrip_Overlay.pm - now, I've renamed 
this file to Scrip.pm since this is the file that it is meant to extend.
After doing some tests, I could not get RT to use the extended 
Scrip.pm - maybe you could provide some insight on that.


However, when I placed the extended Scrip.pm into local/lib/RT, scrip 
activation and deactivation worked as expected.


Any ideas ?

*David Moreau Simard*


On 11-12-28 2:17 PM, David Moreau Simard wrote:

Okay, I've figured it out what was the issue.
In the patch you provided, the file hierarchy isn't the same as the 
one I have.


If I look at /opt/rt4/share/html, I have the following:
drwxr-xr-x 10 root bin  4096 Dec 28 12:24 Admin
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Approvals
drwxr-xr-x  4 root bin  4096 Dec 28 12:24 Articles
-rw-r--r--  1 root bin  2263 Dec 28 12:24 autohandler
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Dashboards
-rw-r--r--  1 root bin  2285 Dec 28 12:24 dhandler
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Download
drwxr-xr-x 15 root bin  4096 Dec 28 12:24 Elements
drwxr-xr-x  4 root bin  4096 Dec 28 12:24 Helpers
-rw-r--r--  1 root bin  5158 Dec 28 12:24 index.html
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Install
-rw-r--r--  1 root bin  2188 Dec 28 12:24 l
drwxr-xr-x  5 root bin  4096 Dec 28 12:24 m
drwxr-xr-x  9 root bin  4096 Dec 28 12:24 NoAuth
drwxr-xr-x  2 root bin  4096 Dec 28 12:24 Prefs
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 REST
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Search
drwxr-xr-x  5 root bin  4096 Dec 28 12:24 SelfService
drwxr-xr-x  5 root bin  4096 Dec 28 12:24 Ticket
drwxr-xr-x  2 root bin  4096 Dec 28 12:24 Tools
drwxr-xr-x  2 root bin  4096 Dec 28 12:24 User
drwxr-xr-x  3 root bin  4096 Dec 28 12:24 Widgets

Now, in the rt_local folder of the patch, the html folder looks like 
this:

drwxrwxrwx 3 root root 4096 Dec  5 03:49 Admin
drwxrwxrwx 2 root root 4096 Dec  5 03:50 Queues

Notice the Queues folder ? I moved it inside Admin - just like in the 
default hierarchy:

# ls -al /opt/rt4/share/html/Admin/
total 48
drwxr-xr-x 10 root bin 4096 Dec 28 12:24 .
drwxr-xr-x 20 root bin 4096 Dec 28 12:24 ..
drwxr-xr-x  4 root bin 4096 Dec 28 12:24 Articles
-rw-r--r--  1 root bin 2213 Dec 28 12:24 autohandler
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 CustomFields
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Elements
drwxr-xr-x  3 root bin 4096 Dec 28 12:24 Global
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Groups
-rw-r--r--  1 root bin 2268 Dec 28 12:24 index.html
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Queues
drwxr-xr-x  3 root bin 4096 Dec 28 12:24 Tools
drwxr-xr-x  2 root bin 4096 Dec 28 12:24 Users

I now get the global scrip activation toggles inside the queue scrips 
configuration.
I'm now testing to see if I am able to get the expected behavior from 
my global scrips.


I've created a dummy global scrip which re-opens a ticket if the 
status is changed. If I change the status to stalled, it resets the 
ticket's status to open.
Now, I've tried deactivating the scrip both through the global 
section and the queue section but it keeps going.


Trying to figure out what is the issue and I will report back !

*David Moreau Simard*


RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012


Re: [rt-users] RT-Extention-QueueDeactivatedScrips

2011-12-02 Thread David Moreau Simard

  
  
I, for one, would be highly interested in trying the patch out.

I have a 4.0.4 development environment on which I could test it on -
I would report back with compatibility details.


  
  - David


On 11-12-02 9:10 AM, Givano wrote:
Hi guys,
  
  
  if it's still interesting, I have done the patch for rt 4.0.2
and it works fine for me. Only three files need to be modified
two html and one lib. If you want I can send you diffs or the
files for rt4.0.2. I dont know if it will work with 4.0.4.
  
  
  BR, Ivan

2011/10/6 Ruslan Zakirov r...@bestpractical.com
  
Hi,

On Thu, Oct 6, 2011 at 7:25 PM, Randy Black randy.bl...@buckle.com
wrote:
 Know of anyone working on the port?


I don't know. It's on github and there is no forks of the
project.
Torsten packaged the extension, probably newer version
depends on
patches people would send and/or on his upgrade schedule.

  

 -Original Message-
 From: ruslan.zaki...@gmail.com
[mailto:ruslan.zaki...@gmail.com]
On Behalf Of Ruslan Zakirov
 Sent: Thursday, October 06, 2011 12:24 PM
 To: Randy Black
 Cc: rt-users@lists.bestpractical.com
 Subject: Re: [rt-users]
RT-Extention-QueueDeactivatedScrips

 Hi,

 File that couldn't be found was deleted between RT3
and RT4. What
 means that extension has not been ported over RT4.

 On Thu, Oct 6, 2011 at 4:45 PM, Randy Black randy.bl...@buckle.com
wrote:
 Does anyone use this extension and have it
working in a production 4.0.2
 instance of RT?

 I have it installed, but when selecting a queue
and then selecting scrips 
 select from the menu, I get could not find
component for path
 /Admin/Elements/QueueTabs

 Looking through the doc, the wiki and google,
produced nothing.

 Thanks,

 Randy

 
 RT Training Sessions (http://bestpractical.com/services/training.html)
 * San Francisco, CA, USA  October 18 
19, 2011
 * Washington DC, USA  October 31 
November 1, 2011
 * Barcelona, Spain  November 28  29,
2011




 --
 Best regards, Ruslan.




--
Best regards, Ruslan.

RT Training Sessions (http://bestpractical.com/services/training.html)
* San Francisco, CA, USA October 18  19, 2011
* Washington DC, USA October 31  November 1, 2011
* Barcelona, Spain November 28  29, 2011

  


  
  
  
  
  
RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012

  


RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston — March 5  6, 2012

Re: [rt-users] Using __CurrentUser__ in a Custom Field LinkValuesTo

2011-06-21 Thread David Moreau Simard

Thanks,

I've simply added the following to %placeholders and it did the trick:
CurrentUser = { value = sub { $_[0]-CurrentUser-UserObj-Name 
}, escape = 1 },


Appreciate it,

- David


2011 Training: http://bestpractical.com/services/training.html


[rt-users] Question about On Queue Change Scrip Condition

2010-09-20 Thread David Moreau Simard

 Hi,

We're running RT 3.8.8 and we need to fire a scrip when a ticket is 
transferred away from a queue (to any possible destination).


The condition built into RT On queue change only seems to fire when a 
ticket is transferred in but not when a ticket is transferred out.


I've tried various possible workarounds in custom conditions and even 
changing the stage of the transaction but to no avail.


Does anyone have a clue as to what kind of condition I could use to 
trigger my scrip when a ticket is transferred out ?

These possible conditions do not work:

my $transaction = $self-TransactionObj;
return($transaction-Type = Set  $transaction-Field = Queue  
$transaction-OldValue eq queuename);
return($transaction-Type = Set  $transaction-Field = Queue  
$transaction-NewValue ne queuename);


Thanks,

- David

RT Training in Washington DC, USA on Oct 25  26 2010
Last one this year -- Learn how to get the most out of RT!


Re: [rt-users] Question about On Queue Change Scrip Condition

2010-09-20 Thread David Moreau Simard
 This is so weird.. would it be a bug ? Because the code certainly 
doesn't behave the way I would expect.


I've tried several things as a global scrip as Kenneth recommended:
Condition: User Defined
Action: User Defined
Template: Blank

Custom Condition:
my $Transaction = $self-TransactionObj;

# Attempt #1
return($transaction-Type = Set  $transaction-Field = Queue  
$transaction-OldValue eq queuename);


 This will return true only if the ticket is transferred TO 
queuename, it will not trigger if it is transferred away from queuename


# Attempt #2
return($transaction-Type = Set  $transaction-Field = Queue  
$transaction-NewValue eq queuename);


 Same result as attempt #1 (How can this be?)

I've done other attempts but still in vain.

This should really be trivial as I'm used to toying with RT conditions 
and actions but I somehow can't figure this one out.


On 10-09-20 1:27 PM, Kenneth Marshall wrote:

Hi David,

If there is not an alternative in the wiki, it probably does not
exist. (yet) At a first glance, I do not know how you would do
it without triggering on every queue change, whether the functionality
were built-in or not. In any case, the queue change action should be
much less frequent than many other actions so the impact should not
be too bad. YMMV

Regards,
Ken



On 10-09-20 1:21 PM, Kenneth Marshall wrote:

You need to have a global scrip that check for a queue change
and if the previous queue was the queue that you want to track
or react to exits.

Cheers,
Ken

On Mon, Sep 20, 2010 at 01:19:32PM -0400, David Moreau Simard wrote:

  Hi,

We're running RT 3.8.8 and we need to fire a scrip when a ticket is
transferred away from a queue (to any possible destination).

The condition built into RT On queue change only seems to fire when a
ticket is transferred in but not when a ticket is transferred out.

I've tried various possible workarounds in custom conditions and even
changing the stage of the transaction but to no avail.

Does anyone have a clue as to what kind of condition I could use to trigger
my scrip when a ticket is transferred out ?
These possible conditions do not work:

my $transaction = $self-TransactionObj;
return($transaction-Type = Set  $transaction-Field = Queue
$transaction-OldValue eq queuename);
return($transaction-Type = Set  $transaction-Field = Queue
$transaction-NewValue ne queuename);

Thanks,

- David

RT Training in Washington DC, USA on Oct 25  26 2010
Last one this year -- Learn how to get the most out of RT!




RT Training in Washington DC, USA on Oct 25  26 2010
Last one this year -- Learn how to get the most out of RT!