[rt-users] clone ticket in RT 4.2
I saw under the General User UI fixes in 4.2.2: * Fix Clone ticket functionality with Select-multiple custom fields. I don't see anything in my UI about cloning a ticket. This is actually a feature I've been desiring, but the old plugin to do it didn't work in the 4.x branch. Am I missing something in the UI or is this a back-end thing that isn't what I'm thinking/hoping it is? Thanks, Brent
[rt-users] Encrypting the DB password in RT_Siteconfig
Is there a way to use an encrypted value for $DatabasePassword in RT_Siteconfig? Thanks, Brent
Re: [rt-users] Encrypting the DB password in RT_Siteconfig
On Tue, Jan 07, 2014 at 09:36:03PM +, Brent Wiese wrote: Is there a way to use an encrypted value for $DatabasePassword in RT_Siteconfig? Thanks, Brent Hi Brent, DBD::Pg uses the libpq library, which supports GSSAPI. You could use that for your authentication instead -- at least if you are using PostgreSQL as your database. Regards, Ken Sorry, I guess I should have mentioned we're using MySQL.
[rt-users] FW: Determine who resolved how many tickets
I'm looking to baseline the performance of my team against the number of tickets they have resolved in RT over a given time. To do this I export the month's tickets from RT into Excel (queue, status=resolved and last updated by) I then use Excel to do a countif to produce my figures. The problem is, I could really do with using a resolved by calculation, rather then last updated by, as last updated by is not always the person who initially resolved the ticket. Any thoughts please? Thanks. First thing I would mention is why export to excel? Build your search, run it, then choose the Chart option, and on the lower left you can rebuild the chart using Last Updated by Real Name and it'll make a nice bar chart. That doesn't solve your resolved by problem though. Since it's not there by default (which I agree would be nice, and I've had dept managers ask me for the same thing), you could add a custom field and populate it when the ticket is resolved, then choose it in the Chart I mention above. If you limit your charting to a single queue, that CF will show up (or I guess any number of queues that CF appears in, but I haven't tested that). Brent
Re: [rt-users] Iterating through multi select CF descriptions
Re-ping: Running RT 4.0.17. I have a CF that is a multi-select. I use the description field to determine whether to fire off certain checks in a scrip. What I can't seem to figure out is how to check every one of the chosen item's description. If I try this, a slight modification of another case where I iterate through the chosen values ($INTval-Content): my $ticket = $self-TicketObj; my $cfINTvals = $ticket-CustomFieldValues($cfINT); while ( my $INTval = ($cfINTvals-Next) ) { if ($INTval-Description eq 'xyz') { It fails with: Prepare failed: RT::ObjectCustomFieldValue::Description Unimplemented in RT::Action::UserDefined. I used to use this, but it no longer suffices as it only checks the first chosen field description: my $value_obj = RT::CustomFieldValue-new( $ticket-CurrentUser ); $value_obj-LoadByCols(CustomField = $cfid, Name = $ticket-FirstCustomFieldValue($cfid)); my $desc = $value_obj-Description; if ($desc eq 'xyz') { I tried this, a variation of both (chaning FirstCustomFieldValue to CustomFieldValues and trying to Next them): my $value_obj = RT::CustomFieldValue-new( $ticket-CurrentUser ); $value_obj-LoadByCols(CustomField = $cfINT, Name = $ticket-CustomFieldValues($cfINT)); while ( my $desc = ($value_obj-Next)) { my $descval = $desc-Description; if ($descval eq 'xyz') { But it fails with: Prepare failed: RT::CustomFieldValue::Next Unimplemented in RT::Action::UserDefined. I'm hoping this is something really obvious I'm just not seeing after 2 days of pulling out my hair... Thanks in advance for any suggestions. Brent
[rt-users] FW: Getting custom field value AND description in a scrip
Hi. In our RT setup, a user chooses a value from a drop down list (a custom field called ‘application’) to indicate what software they want help with when they submit a new ticket. I set up a scrip that checks the value of that custom field and moves the ticket into the appropriate queue (based on which application they need help with). Instead of hard coding a mapping of each application value to a queue name, I’d like to put the name of the queue into the custom field description. For example, the custom fields might look like this: SortNameDescription Category 0 Microsoft Wordhelpdesk 0 Microsoft Excel helpdesk 0 SharePoint developers 0 PeopleSoft hr If the user selected “SharePoint” as the application they wanted help with, the scrip would read the description field and see that it should move the ticket into the “developers” queue. I’ve got everything working great with static mapping, I just can’t figure out a way to retrieve that Description within a scrip. Has anyone done this before? Thanks! Brent Yes, we do something very similar. If that CF is a single-select, then this code snip will do what you want. Unfortunately, mine is a multi-select and I can’t figure out how to iterate through all the values. I’ve posted the question with no response… This still works, but only uses the first value. Anyways: my $ticket = $self-TicketObj; my $cfINT = 9; my $value_obj = RT::CustomFieldValue-new( $ticket-CurrentUser ); $value_obj-LoadByCols(CustomField = $cfINT, Name = $ticket-FirstCustomFieldValue($cfINT)); my $descval = $value_obj-Description; if ($descval eq 'sharepoint') { … do your code bits here } elsif ($descval eq '…’ … you get the idea
[rt-users] rt-crontool send email to watchers but not log event
I'm trying to do something similar to the Reminders notification via rt-crontool: http://requesttracker.wikia.com/wiki/Reminders But instead of notifying an owner of their reminder, I want to notify the queue watchers (and owner, but that's less important) when a ticket hasn't been touched in some time period. The problem is, I can't figure out how to make it notify the watchers using the above example. The alternative method I found was to log a comment, but if I do that, that updates the ticket LastUpdated, which is what I'm searching against, which resets the clock. A much more complicated setup could/would be achieved using the SLA extension, which is where I may end up having to go, but was hoping to knock this out quickly. Thanks, Brent
[rt-users] Iterating through multi select CF descriptions
Running RT 4.0.17. I have a CF that is a multi-select. I use the description field to determine whether to fire off certain checks in a scrip. What I can't seem to figure out is how to check every one of the chosen item's description. If I try this, a slight modification of another case where I iterate through the chosen values ($INTval-Content): my $ticket = $self-TicketObj; my $cfINTvals = $ticket-CustomFieldValues($cfINT); while ( my $INTval = ($cfINTvals-Next) ) { if ($INTval-Description eq 'xyz') { It fails with: Prepare failed: RT::ObjectCustomFieldValue::Description Unimplemented in RT::Action::UserDefined. I used to use this, but it no longer suffices as it only checks the first chosen field description: my $value_obj = RT::CustomFieldValue-new( $ticket-CurrentUser ); $value_obj-LoadByCols(CustomField = $cfid, Name = $ticket-FirstCustomFieldValue($cfid)); my $desc = $value_obj-Description; if ($desc eq 'xyz') { I tried this, a variation of both (chaning FirstCustomFieldValue to CustomFieldValues and trying to Next them): my $value_obj = RT::CustomFieldValue-new( $ticket-CurrentUser ); $value_obj-LoadByCols(CustomField = $cfINT, Name = $ticket-CustomFieldValues($cfINT)); while ( my $desc = ($value_obj-Next)) { my $descval = $desc-Description; if ($descval eq 'xyz') { But it fails with: Prepare failed: RT::CustomFieldValue::Next Unimplemented in RT::Action::UserDefined. I'm hoping this is something really obvious I'm just not seeing after 2 days of pulling out my hair... Thanks in advance for any suggestions. Brent
Re: [rt-users] Fetchmail Exchange 2003 have stopped playing nicely
What protocol are you using? We use imap via TLS and we see this all the time in our logs, but it's actually working fine (first Exchange 2007, now 2010). I think it has unsupported auth mechanisms in its list, so we see these as it tries them, then fails to the next one. Fetchmail has a non-daemon run mode that can give you a lot of info (fetchmail --vvv --nodetach --nosyslog -f /path/to/fetchmail-config-file) Brent Wiese From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Cena, Stephen (ext. 300) Sent: Wednesday, May 29, 2013 11:04 AM To: rt-users@lists.bestpractical.com Subject: [rt-users] Fetchmail Exchange 2003 have stopped playing nicely Now my fetchmail services on both servers no longer work. I keep getting authentication errors: http://www.fetchmail.info/fetchmail-FAQ.html#R15 Nothing I'm trying seems to work correctly. I'm guessing it's security patches on our Exchange server because this was working fine on our first server for over a year. I'm Google-ing RT and Exchange and not coming up with anything. Does anyone have any suggestions or links? Thanks! Stephen Cena QVII MIS/IT Dept 850 Hudson Ave. Rochester, NY. 14620 585-544-0450 x300 s...@qvii.commailto:s...@qvii.com Thank you for helping us help you help us all. --For email related issues, please contact postmas...@qvii.commailto:postmas...@qvii.com -- RT Training in Seattle, June 19-20: http://bestpractical.com/training
[rt-users] Cloning an existing ticket
I'm running RT 4.0.10. I tried installing rt-extension-cloneticket-withdata. It looks like that hasn't been updated in a while - not since rt 4 anyways. When I try cloning a ticket, I get: RT: Not an ARRAY reference at /opt/rt4/local/plugins/RT-Extension-CloneTicket-WithData/html/Ticket/Clone/index.html line 183.#012#012Stack:#012 [/opt/rt4/local/plugins/RT-Extension-CloneTicket-WithData/html/Ticket/Clone/index.html:183]#012 [/opt/rt4/share/html/Ticket/autohandler:66]#012 [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:634]#012 [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:335]#012 [/opt/rt4/share/html/autohandler:53] (/opt/rt4/sbin/../lib/RT/Interface/Web/Handler.pm:208) Anyone have this running on RT 4? If not, any alternatives? Thanks, Brent -- RT Training in Seattle, June 19-20: http://bestpractical.com/training
[rt-users] Getting a clean ticket history
Is there a way to copy/paste, export, or some other means a ticket's entire history? I searched around the archives and didn't find anything that would work for me. I tried to forward a ticket to my email address hoping that would work, but it didn't include comments. It was also a mess of attached messages, not a single listing. I also tried installing the windows generic / text printer driver and the output rendered terribly (not surprising). Thanks, Brent -- RT Training in Seattle, June 19-20: http://bestpractical.com/training
[rt-users] Playing WAV file attachment from RT ticket
From time to time we have users forward voicemails to our RT4 system. If an agent right-clicks and saves the file, then opens it, it launches media player fine and they can hear it. But, if you just click the attachment, it'll open media player, but error out. It looks like what happens is media player is actually trying to go to the URL of the attachment. This fails because of authentication. I can see that in the apache logs. Is there any way to force this to work properly? Maybe force download of the file before launching media player? Turn off authentication for wav attachment URL's if the player matches media player? Thanks, Brent -- RT Training in Seattle, June 19-20: http://bestpractical.com/training
[rt-users] Ignoring out of office emails
I have a powershell script that emails users (using the System.Net.Mail class) and the From address is set to our RT system, making it easier for users to get help if needed. The problem is, people's out-of-office responses are opening tickets. I added the Precendence: bulk header after checking through the RT lists as it looks like (at least in rt 3.x) it would filter those emails out and not interact with tickets. But it's not working. Is this no longer the case in RT4? Or does it not apply to ticket creation? I can see the Precendence: bulk header being added in the original email. I was hoping to not have to modify RT/procmail, but I can go that route. Thanks, Brent
Re: [rt-users] configure RT-Authen-ExternalAuth to not verify certificates
Hello All, Is there anyway to configure RT-Authen-ExternalAuth to not verify ssl certificates? I'm hitting an ldap server that has a self-signed cert and it would be much more simple to not verify the certificate. I tried adding verify = 'none' to net_ldap_args which is used by Net::LDAP start_tls but that didn't work. -- Later, Darin I realize this is an old post, but I didn't see any responses. I struggled with this too. Turned out to be far easier to append the self-signed cert (or internal CA depending on your situation) to my ca-bundle.crt file on my RT box.
[rt-users] FW: logo change
I'm trying to change the logo through /Admin/Tools/Theme.html , but when I click upload just waits and waits the clears the upload and stops. The most reliable way I've found is to overwrite bpslogo.png at /opt/rt4/share/html/NoAuth/images I'd suggest keeping a copy around of your logo as upgrades will likely overwrite your change. I haven't tried putting it in the local folders to avoid that overwrite problem. Might be worth trying... You'll likely have to create some of the path yourself: /opt/rt4/local/html/NoAuth/images/bpslogo.png
[rt-users] ExternalAuth to active directory over SSL
On Fri, 2012-03-23 at 15:05 -0700, Brent Wiese wrote: I noticed in the notes that when you enable SSL/TLS, it invokes NET::SSLeay. This is why RT::Authen::ExternalAuth prompts about SSL LDAP Connections when you run `perl Makefile.PL`. I'd installed via cpan so didn't notice that before. Didn’t appear to be installed. I installed via cpan… and now Apache seg faults when I try to start it. It’s seg faulting on: This generally means that you're running mod_perl, and Net::SSLeay is disagreeing with something else in the system (be it Apache, or your database handle) which also wants to load the SSL libraries -- and the libraries are ending up in an inconsistent state. As a first step, try disabling Apache's SSL, or switching from mod_perl to mod_fcgid or mod_fastcgi, and see if it helps. - Alex I switched to fcgid and was able to get apache running again. Still same problems with the external auth. Figuring maybe there was an issue when I first installed because Net::SSLeay wasn't installed, I grabbed the latest stable and manually built. Looks like it found everything correctly: *** Module::AutoInstall version 1.04 *** Checking for Perl dependencies... [SSL LDAP Connections] - Net::SSLeay ...loaded. (1.45) [External LDAP Sources] - Net::LDAP ...loaded. (0.44) [External DBI Sources] - DBI ...loaded. (1.618) [SSO Cookie Sources] - CGI::Cookie ...loaded. (1.30) *** Module::AutoInstall configuration finished. Checking if your kit is complete... Looks good Alas, no, it didn't help: [Tue Mar 27 16:43:36 2012] [critical]: RT::Authen::ExternalAuth::LDAP::_GetBoundLdapObj Can't bind: LDAP_OPERATIONS_ERROR 1 (/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:492) I'm not convinced it works. I challenge someone to respond with yes, I can successfully use ExternalAuth against AD via SSL and post their challenges/config. :) I just don't know where to go from here.
[rt-users] FW: ExternalAuth to active directory over SSL
On 03/27/2012 12:48 PM, Brent Wiese wrote: Alas, no, it didn't help: [Tue Mar 27 16:43:36 2012] [critical]: RT::Authen::ExternalAuth::LDAP::_GetBoundLdapObj Can't bind: LDAP_OPERATIONS_ERROR 1 (/opt/rt4/local/plugins/RT-Authen- ExternalAuth/lib/RT/Authen/ExternalA uth/LDAP.pm:492) Note that you're no longer getting segfaults from Apache, meaning you solved the SSL lib conflict between Perl and Apache. The error above is a pure bind error. What's your ExternalAuth config? I suspect you configured it to talk TLS to your SSL port. Thomas I've tried setting tls to 0 and 1. When it's set to 1, it looks like it sends the bind in cleartext (I see the bind credentials in tcpdump). When set to 0 it looks fully encrypted. Again, the server/user/pw/port stuff all works right with ldapsearch... Here is my config at present (sanitized of course): Set( @Plugins, qw(RT::Authen::ExternalAuth) ); Set($ExternalAuthPriority, [ 'My_LDAP' ]); Set($ExternalInfoPriority, [ 'My_LDAP' ]); Set($ExternalServiceUsesSSLorTLS,1); Set($AutoCreateNonExternalUsers,1); Set($ExternalSettings, { 'My_LDAP' = { ## GENERIC SECTION 'type' = 'ldap', 'server'= 'dc05.my.ad', 'user' = 'CN=Apache LDAP,OU=Service Accounts,DC=my,DC=ad', 'pass' = 'xxx', 'base' = 'DC=my,DC=ad', 'filter'= '(ObjectClass=User)', 'd_filter' = '(userAccountControl:1.2.840.113556.1.4.803:=2)', 'tls' = 0, 'ssl_version' = 3, 'net_ldap_args' = [ version = 3, port = 636, debug = 8 ], 'attr_match_list' = [ 'Name', 'EmailAddress' ], 'attr_map' = { 'Name' = 'sAMAccountName', 'EmailAddress' = 'mail', 'ExternalAuthId' = 'sAMAccountName', 'Gecos' = 'sAMAccountName' } }, } );
[rt-users] ExternalAuth to active directory over SSL (SOLVED)
On 03/27/2012 01:56 PM, Brent Wiese wrote: 'tls' = 0, 'ssl_version' = 3, 'net_ldap_args' = [ version = 3, port = 636, debug = 8 ], You're mixing TLS with the SSL port. Try this: tls = 1, net_ldap_args = [ version = 3, debug = 8 ], Don't include ssl_version or port. Thomas Yep, that was the ticket. Thank you very much for the help! In case anyone experiences the same situation, here is the quick-n-dirty list of what I had to do to get it working: 1: make sure the CA chain for whatever domain controller(s) you're connecting to is added to your cert bundle. On my system (CentOS 6), it was /etc/pki/tls/certs/ca-bundle.crt (which looks to be linked to /etc/ssl/certs/ca-bundle.crt) Afterwards, I was able to connect without any cert errors: openssl s_client -connect dc.mydomain.local:636 -CApath /etc/ssl/certs 2: for ldapsearch (I believe its installed with openldap-clients, or maybe openldap-devel) to work properly, I had to add this to /etc/openldap/ldap.conf: TLS_CACERT /etc/pki/tls/certs/ca-bundle.crt Once I added that line, this ldapsearch worked: ldapsearch -d 2 -LLL -v -x -H ldaps:// dc.mydomain.local:636 -b 'DC=mydomain,DC=local' -D 'CN=Apache,OU…,DC= mydomain,DC=local' -w '**pass**' '(sn=smith)' cn sn 3: NET::SSLeay wasn't installed on my system, so I installed through CPAN. 4: #3 broke apache (segmentation faults) on my system using mod_perl. I switched to mod_fcgid. Plenty of posts on how to configure this. It wasn't hard - the only catch was to make sure the directory you set for the socket file (I used /tmp/fcgid/sock.rt4) is writeable by apache (root creates it before it switching to your apache user). I also had to modify the perms on rt-server.log so apache could write to it. 5: I installed ExternalAuth via cpan prior to #3. Since I wasn't sure if it compiled correctly (I don't recall any errors, but it's been over a week now so my memory has faded), I grabbed the latest stable from the site and compiled it myself. I know it found NET::SSLeay this time around. This may not be a necessary step if you're just starting out - installing via cpan is easier. 6: Here is my config as it relates to ExternalAuth after the changes Thomas mentions above: Set( @Plugins, qw(RT::Authen::ExternalAuth) ); Set($ExternalAuthPriority, [ 'My_LDAP' ]); Set($ExternalInfoPriority, [ 'My_LDAP' ]); Set($ExternalServiceUsesSSLorTLS,1); # We set below to true because we support external customers via email. # We only need to use AD to authenticate our support reps that work the tickets. Set($AutoCreateNonExternalUsers,1); Set($ExternalSettings, { 'My_LDAP' = { 'type' = 'ldap', 'server'= 'dc05.my.ad', 'user' = 'CN=Apache LDAP,OU=Service Accounts,DC=my,DC=ad', 'pass' = 'xxx', 'base' = 'DC=my,DC=ad', 'filter'= '(ObjectClass=User)', 'd_filter' = '(userAccountControl:1.2.840.113556.1.4.803:=2)', 'tls' = 1, 'net_ldap_args' = [ version = 3, debug = 8 ], 'attr_match_list' = ['Name', 'EmailAddress' ], 'attr_map' = { 'Name' = 'sAMAccountName', 'EmailAddress' = 'mail', 'ExternalAuthId' = 'sAMAccountName', 'Gecos' = 'sAMAccountName' } }, } ); Hopefully I remembered everything! Cheers, Brent
Re: [rt-users] ExternalAuth to active directory over SSL
In case anyone is following this thread... I noticed in the notes that when you enable SSL/TLS, it invokes NET::SSLeay. Didn't appear to be installed. I installed via cpan... and now Apache seg faults when I try to start it. It's seg faulting on: Plack::Handler::Apache2-preload(/opt/rt4/sbin/rt-server); If I comment that line out, apache will start, but it doesn't do anything (500 server errors). I've seen some posts about this on the list, but nothing that solved my issue. I tried upgrading all my cpan pm's and yum update (I'm running CentOS) everything to see if that helped... no go. So I'm dead in the water now. Thankfully, this is my test/play system, so my prod system is still running, but unless someone here has a solution, I'm looking at a fresh reload of everything and starting over from scratch... From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Brent Wiese Sent: Wednesday, March 21, 2012 2:11 PM To: rt-users@lists.bestpractical.com Subject: Re: [rt-users] ExternalAuth to active directory over SSL I answered part of my question... I can successfully ldapsearch now. I added TLS_CACERT /etc/pki/tls/certs/ca-bundle.crt To /etc/openldap/ldap.conf. But RT is still failing. If I set: 'tls' = 1, 'ssl_version' = 3, 'net_ldap_args' = [ version = 3, port = 636, debug = 8 ], I get: [Wed Mar 21 21:05:14 2012] [critical]: RT::Authen::ExternalAuth::LDAP::_GetBoundLdapObj Can't bind: LDAP_SERVER_DOWN 81 (/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:492) If I change to this: 'tls' = 0, 'ssl_version' = 3, 'net_ldap_args' = [ version = 3, port = 636, debug = 8 ], I get: [Wed Mar 21 21:09:27 2012] [critical]: RT::Authen::ExternalAuth::LDAP::_GetBoundLdapObj Can't bind: LDAP_OPERATIONS_ERROR 1 (/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:492) So I'm further, but still stuck. From: rt-users-boun...@lists.bestpractical.commailto:rt-users-boun...@lists.bestpractical.com [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Brent Wiese Sent: Wednesday, March 21, 2012 12:23 PM To: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com Subject: [rt-users] ExternalAuth to active directory over SSL I have ExternalAuth working fine over regular LDAP. But I need to run it over LDAPS for security reasons. We use an internal CA for our certs. I've added it to /etc/pki/tls/certs/ca-bundle.crt (which looks to be linked to /etc/ssl/certs/ca-bundle.crt) This runs successfully (used to error before I added the CA certs to the bundle): openssl s_client -connect dc.mydomain.local:636 -CApath /etc/ssl/certs I've also verified the cert/cert chain: openssl verify -CAfile /etc/ssl/certs/ca-bundle.crt dc.mydomain.local.pem dc.mydomain.local.pem: OK However, this errors out with a bad cert error (shortened -D, but it's the same string that works when using LDAP and ldapsearch over regular ldap works fine): ldapsearch -d 2 -LLL -v -x -H ldaps:// dc.mydomain.local:636 -b 'DC=mydomain,DC=local' -D 'CN=Apache,OU...,DC= mydomain,DC=local' -w '**pass**' '(sn=smith)' cn sn Results (snipped hex code): ldap_initialize( ldaps://dc.mydomain.local:636/??base ) tls_write: want=60, written=60 tls_read: want=3, got=3 tls_read: want=2, got=2 tls_read: want=2724, got=2724 TLS: certificate [CN= dc.mydomain.local] is not valid - error -8179:Unknown code ___f 13. tls_write: want=7, written=7 TLS: error: connect - force handshake failure: errno 21 - moznss error -8179 TLS: can't connect: TLS error -8179:Unknown code ___f 13. ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1) Running LDP.exe on the domain controllers running in SSL mode works fine. RT's log gives the following: [Wed Mar 21 19:04:41 2012] [critical]: RT::Authen::ExternalAuth::LDAP::_GetBoundLdapObj Can't bind: LDAP_OPERATIONS_ERROR 1 (/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:492) So I'm guessing it's probably getting that same is not valid error... but why? I've googled for hours looking for anything beyond making sure the CA cert was in the bundle. Does ldapsearch/RT externalAuth use a different CA bundle than /etc/pki/tls/certs/ca-bundle.crt (or the linked /etc/ssl/certs/ca-bundle.crt)? Any idea what I'm missing? Running centos 6 and openssl -1.0.0-20.el6_2.2.x86_64 (latest in yum repo... same thing when I ran 1.0.0-10 too). Brent
[rt-users] ExternalAuth to active directory over SSL
I have ExternalAuth working fine over regular LDAP. But I need to run it over LDAPS for security reasons. We use an internal CA for our certs. I've added it to /etc/pki/tls/certs/ca-bundle.crt (which looks to be linked to /etc/ssl/certs/ca-bundle.crt) This runs successfully (used to error before I added the CA certs to the bundle): openssl s_client -connect dc.mydomain.local:636 -CApath /etc/ssl/certs I've also verified the cert/cert chain: openssl verify -CAfile /etc/ssl/certs/ca-bundle.crt dc.mydomain.local.pem dc.mydomain.local.pem: OK However, this errors out with a bad cert error (shortened -D, but it's the same string that works when using LDAP and ldapsearch over regular ldap works fine): ldapsearch -d 2 -LLL -v -x -H ldaps:// dc.mydomain.local:636 -b 'DC=mydomain,DC=local' -D 'CN=Apache,OU...,DC= mydomain,DC=local' -w '**pass**' '(sn=smith)' cn sn Results (snipped hex code): ldap_initialize( ldaps://dc.mydomain.local:636/??base ) tls_write: want=60, written=60 tls_read: want=3, got=3 tls_read: want=2, got=2 tls_read: want=2724, got=2724 TLS: certificate [CN= dc.mydomain.local] is not valid - error -8179:Unknown code ___f 13. tls_write: want=7, written=7 TLS: error: connect - force handshake failure: errno 21 - moznss error -8179 TLS: can't connect: TLS error -8179:Unknown code ___f 13. ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1) Running LDP.exe on the domain controllers running in SSL mode works fine. RT's log gives the following: [Wed Mar 21 19:04:41 2012] [critical]: RT::Authen::ExternalAuth::LDAP::_GetBoundLdapObj Can't bind: LDAP_OPERATIONS_ERROR 1 (/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:492) So I'm guessing it's probably getting that same is not valid error... but why? I've googled for hours looking for anything beyond making sure the CA cert was in the bundle. Does ldapsearch/RT externalAuth use a different CA bundle than /etc/pki/tls/certs/ca-bundle.crt (or the linked /etc/ssl/certs/ca-bundle.crt)? Any idea what I'm missing? Running centos 6 and openssl -1.0.0-20.el6_2.2.x86_64 (latest in yum repo... same thing when I ran 1.0.0-10 too). Brent
Re: [rt-users] ExternalAuth to active directory over SSL
I answered part of my question... I can successfully ldapsearch now. I added TLS_CACERT /etc/pki/tls/certs/ca-bundle.crt To /etc/openldap/ldap.conf. But RT is still failing. If I set: 'tls' = 1, 'ssl_version' = 3, 'net_ldap_args' = [ version = 3, port = 636, debug = 8 ], I get: [Wed Mar 21 21:05:14 2012] [critical]: RT::Authen::ExternalAuth::LDAP::_GetBoundLdapObj Can't bind: LDAP_SERVER_DOWN 81 (/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:492) If I change to this: 'tls' = 0, 'ssl_version' = 3, 'net_ldap_args' = [ version = 3, port = 636, debug = 8 ], I get: [Wed Mar 21 21:09:27 2012] [critical]: RT::Authen::ExternalAuth::LDAP::_GetBoundLdapObj Can't bind: LDAP_OPERATIONS_ERROR 1 (/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:492) So I'm further, but still stuck. From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Brent Wiese Sent: Wednesday, March 21, 2012 12:23 PM To: rt-users@lists.bestpractical.com Subject: [rt-users] ExternalAuth to active directory over SSL I have ExternalAuth working fine over regular LDAP. But I need to run it over LDAPS for security reasons. We use an internal CA for our certs. I've added it to /etc/pki/tls/certs/ca-bundle.crt (which looks to be linked to /etc/ssl/certs/ca-bundle.crt) This runs successfully (used to error before I added the CA certs to the bundle): openssl s_client -connect dc.mydomain.local:636 -CApath /etc/ssl/certs I've also verified the cert/cert chain: openssl verify -CAfile /etc/ssl/certs/ca-bundle.crt dc.mydomain.local.pem dc.mydomain.local.pem: OK However, this errors out with a bad cert error (shortened -D, but it's the same string that works when using LDAP and ldapsearch over regular ldap works fine): ldapsearch -d 2 -LLL -v -x -H ldaps:// dc.mydomain.local:636 -b 'DC=mydomain,DC=local' -D 'CN=Apache,OU...,DC= mydomain,DC=local' -w '**pass**' '(sn=smith)' cn sn Results (snipped hex code): ldap_initialize( ldaps://dc.mydomain.local:636/??base ) tls_write: want=60, written=60 tls_read: want=3, got=3 tls_read: want=2, got=2 tls_read: want=2724, got=2724 TLS: certificate [CN= dc.mydomain.local] is not valid - error -8179:Unknown code ___f 13. tls_write: want=7, written=7 TLS: error: connect - force handshake failure: errno 21 - moznss error -8179 TLS: can't connect: TLS error -8179:Unknown code ___f 13. ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1) Running LDP.exe on the domain controllers running in SSL mode works fine. RT's log gives the following: [Wed Mar 21 19:04:41 2012] [critical]: RT::Authen::ExternalAuth::LDAP::_GetBoundLdapObj Can't bind: LDAP_OPERATIONS_ERROR 1 (/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:492) So I'm guessing it's probably getting that same is not valid error... but why? I've googled for hours looking for anything beyond making sure the CA cert was in the bundle. Does ldapsearch/RT externalAuth use a different CA bundle than /etc/pki/tls/certs/ca-bundle.crt (or the linked /etc/ssl/certs/ca-bundle.crt)? Any idea what I'm missing? Running centos 6 and openssl -1.0.0-20.el6_2.2.x86_64 (latest in yum repo... same thing when I ran 1.0.0-10 too). Brent
[rt-users] Username and email address template is sent to
I'm trying to find out how to print the username and email address of the person a template is being email to. So, for example, when you comment on a ticket, I want to add the following into the template: This email was sent to Joe Blow (jb...@nowhere.commailto:jb...@nowhere.com). Thanks, Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
[rt-users] FW: CustomField input must match formatting in edit
On Mon, Feb 06, 2012 at 04:54:51PM -0700, Brent Wiese wrote: Sorry, wasn't sure if a screenshot would come through on the list. The layout of that field could use some loving, it has a CSS class these days so it should be much easier to do things to it: cfinvalidfield Yeah, I played a little with that CSS, but since it was inconsistent between different types of fields, and IIRC (yesterday is a blur at this point), that CSS is also used on the create ticket, I was hoping there was another solution or a bug in the modify html page that I was too blind to see that could be corrected. It was a long (and productive thanks to the awesome structure of RT) day of coding. Maybe a different topic, but while debugging the formatting above, I noticed if I use a * in a custom field validation (ie: I want to allow the field to contain only digits or be empty, so I modified the regex from ^[\d.]+$ to ^[\d.]*$), the validation works, but it doesn’t display the “Input must match…” text at all. RT decides whether or not display the hint by validating all the CFs at page render time. This means that since * matches the empty field, it doesn't have an error hint to show. Frankly - it'd probably be a lot better if we just started showing the Description of Custom Fields as a Hint box on 4.2. That makes sense, but it'd be nice if it rendered the comment in the validation regardless of whether it validated the regex. Or, as you suggest, show the CF description. Thanks again! Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
[rt-users] CustomField input must match formatting in edit
I've noticed this in both IE and FireFox. I'm running 4.0.4. When editing a ticket that has custom fields with validation (mandatory), some of them display the Input must match... under the CF name, not the entry. For example (hopefully this will format right on the listserv), if I have a select 1 value dropdown, it will look like this: CF Name Dropdown box italics Select one value red italicsInput must match [Mandatory] In other types of fields, like a text area, it looks like this: CF Name TextArea italics Select one value TextArea Continued red italicsInput must match [Mandatory] Actually, it looks like select one value is the only one that formats that way, which when I look at it, looks correct/clean. When it's shifted left, to me anyways, it implies the field below, not above, is mandatory. I tried monkeying with the CSS to see if I could get it to place right, but it didn't. I'm not sure which is the intended way for it to format, but it'd be nice to either be able to change it, or at least have it consistent for all field types. Maybe a different topic, but while debugging the formatting above, I noticed if I use a * in a custom field validation (ie: I want to allow the field to contain only digits or be empty, so I modified the regex from ^[\d.]+$ to ^[\d.]*$), the validation works, but it doesn't display the Input must match... text at all. Thanks! Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
Re: [rt-users] CustomField input must match formatting in edit
Sorry, wasn't sure if a screenshot would come through on the list. Attached. Brent Wiese Direct Number: (480) 993-0788 Mobile Number: (480) 286-6557 -Original Message- From: ruslan.zaki...@gmail.com [mailto:ruslan.zaki...@gmail.com] On Behalf Of Ruslan Zakirov Sent: Monday, February 06, 2012 3:55 PM To: Brent Wiese Cc: rt-users@lists.bestpractical.com Subject: Re: [rt-users] CustomField input must match formatting in edit Hi, A screenshot would be helpful. On Tue, Feb 7, 2012 at 02:46, Brent Wiese bwi...@elementps.com wrote: I’ve noticed this in both IE and FireFox. I’m running 4.0.4. When editing a ticket that has custom fields with validation (mandatory), some of them display the “Input must match…” under the CF name, not the entry. For example (hopefully this will format right on the listserv), if I have a select 1 value dropdown, it will look like this: CF Name Dropdown box italics Select one value red italicsInput must match [Mandatory] In other types of fields, like a text area, it looks like this: CF Name TextArea italics Select one value TextArea Continued red italicsInput must match [Mandatory] Actually, it looks like “select one value” is the only one that formats that way, which when I look at it, looks correct/clean. When it’s shifted left, to me anyways, it implies the field below, not above, is mandatory. I tried monkeying with the CSS to see if I could get it to place right, but it didn’t. I’m not sure which is the intended way for it to format, but it’d be nice to either be able to change it, or at least have it consistent for all field types. Maybe a different topic, but while debugging the formatting above, I noticed if I use a * in a custom field validation (ie: I want to allow the field to contain only digits or be empty, so I modified the regex from ^[\d.]+$ to ^[\d.]*$), the validation works, but it doesn’t display the “Input must match…” text at all. Thanks! Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston — March 5 6, 2012 -- Best regards, Ruslan. attachment: CF.jpg RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
Re: [rt-users] ICV and calendar
From the Home screen, click on the queue you want to do this for in the Quick Search tab. After the results are up, drop the Feeds link down and choose iCal. Can do this for any search result. -Original Message- From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Daniel Garcia Mejia Sent: Monday, January 30, 2012 8:40 AM To: rt-users@lists.bestpractical.com Subject: [rt-users] ICV and calendar Hi, I created a queue that whenI create a ticket I want to create a calendar datein my Thunderbird mail agent (the extension to put a date is. ICS). With RT, is possible to do this? To create a ticket to export aICS file to thunderbird? I have read several papers on the module 'Calendar' CPAN but I do not know how it works. Best Regards Dani -- ... __ / / Daniel García Mejía C E / S / C A Portals i Repositoris /_/ Centre de Serveis Científics i Acadèmics de Catalunya Gran Capità, 2-4 (Edifici Nexus) - 08034 Barcelona T. (NULL) - F. 93 205 6979 - dgar...@cesca.cat ... 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
[rt-users] FW: scrip and template to email calendar invite
On Wed, Jan 18, 2012 at 04:33:20PM -0700, Brent Wiese wrote: My assumption is I would need to build a new template. What I can't figure out is the code that goes in the template so the text I'm adding isn't just parsed as the message content itself. You may want to review the docs/customizing/templates.pod included with RT, which also talks about how to set a custom header type. You won't be able to build an attachment from your Template, so hopefully an inline solution works. -kevin It looks like the only custom Content-Type is text/html. I can see where it looks for that in Template.pm. What I need to do is set the Content-Type as: text/calendar; charset=utf-8; method=REQUEST I put an elsif in Template.pm to see if I could get it to pass that header on like text/html but it's not working. Anyone more entrenched in the code able to point me in the right direction? It'd be great if there was some way to just pass the value after Content-Type: in the template to the email... In my case, I actually don't need any readable message content outside of that Content-Type... Thanks, Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
[rt-users] scrip and template to email calendar invite
I've seen the question asked before when I search the archives, but I wasn't able to find an answer my brain could parse. I need to build a scrip and template that will send an Outlook style calendar invite via email with a due date based on a custom field (datetime type). After a good bit of research, I think I have all the lines I need to build the ics file attachment (although being able to do it inline vs an attachment would be gravy - maybe I just need to set the content type to Content-Type: text/calendar; charset=utf-8; method=REQUEST which is what I see when I look at an invite generated from my Outlook client?). But from there I'm pretty much stuck. My assumption is I would need to build a new template. What I can't figure out is the code that goes in the template so the text I'm adding isn't just parsed as the message content itself. The scrip itself is less of a worry - in my particular case, it's going to fire when a ticket is moved into a particular queue only, so that part is pretty easy. I've seen other responses of use the calendar feed or use a different email client but the reality is in my situation that's not an option. It needs to be via email and it needs to be Outlook compatible (the more native the better). RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
Re: [rt-users] RT Mobile via Android
It'll also auto-redirect you after you log in on the regular home page. From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Matt Brennan Sent: Wednesday, January 18, 2012 2:56 PM To: Michael Newland Cc: rt-users@lists.bestpractical.com Subject: Re: [rt-users] RT Mobile via Android https://your.rt.url/m On Wed, Jan 18, 2012 at 16:52, Michael Newland michael.newl...@timco.aeromailto:michael.newl...@timco.aero wrote: How do I go about setting up an Android to use RT? Can't seem to find any documentation on how to do this. We are running RT version 4. Thanks! 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] scrip and template to email calendar invite
Sorry, forgot to mention I'm running 4.0.4... From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Brent Wiese Sent: Wednesday, January 18, 2012 4:33 PM To: rt-users@lists.bestpractical.com Subject: [rt-users] scrip and template to email calendar invite I've seen the question asked before when I search the archives, but I wasn't able to find an answer my brain could parse. I need to build a scrip and template that will send an Outlook style calendar invite via email with a due date based on a custom field (datetime type). After a good bit of research, I think I have all the lines I need to build the ics file attachment (although being able to do it inline vs an attachment would be gravy - maybe I just need to set the content type to Content-Type: text/calendar; charset=utf-8; method=REQUEST which is what I see when I look at an invite generated from my Outlook client?). But from there I'm pretty much stuck. My assumption is I would need to build a new template. What I can't figure out is the code that goes in the template so the text I'm adding isn't just parsed as the message content itself. The scrip itself is less of a worry - in my particular case, it's going to fire when a ticket is moved into a particular queue only, so that part is pretty easy. I've seen other responses of use the calendar feed or use a different email client but the reality is in my situation that's not an option. It needs to be via email and it needs to be Outlook compatible (the more native the better). RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
[rt-users] Queue issue when using Requestor perms
A priv'd user creates a ticket in queue A. An Admin moves it to queue B. Queue B has create/reply perms for Everyone (temporarily) and Comment/View CF/View Queue/View Ticket Summaries for Requestor. The requestor can continue to see the ticket (logged out and back in to confirm this isn't a caching thing) and comment/reply. However, if they click on The Basics, the queue field resets back to the original queue A and the current queue B is not in the list. If they save anything, it moves it back to the original queue A. Shouldn't the current queue B be there since view queue is set for Requestor? In fact, if you add all the perms together for this requestor, it matches or exceeds the original queue. Rt 4.0.4. Thanks! Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
[rt-users] Modifying a ticket via mobile interface
RT 4.0.4... Like the mobile interface, except its seems you can't modify a ticket (or in my case specifically, a CustomField)? I looked at the /m/ folder and there is a modify file, but its empty of code. Is this right? Forthcoming? ETA? This would be a HUGE benefit to us since our change control approvers could do it right from their phones in our meeting... Thanks, Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
Re: [rt-users] CustomField that displays users
On Tue, Jan 03, 2012 at 10:43:54AM -0700, Brent Wiese wrote: That's what a User-defined Group is. It is a subset of Privileged users that you put in as members. Yeah, I have those. Everyone I want to display is in a group I've defined, but I didn't want to assume I could populate on groups. I have some code that will put all members of a group into a Custom Field. That would be awesome if you could share. I was a little surprised I wasn't able to find anyone asking about it via my searches. I would have thought it would be somewhat common. The example External Custom Field that ships with RT puts groups into a CF, so you should be able to mod that easily to do privileged users. /opt/rt4/docs/extending/external_custom_fields.pod -kevin --- Thanks! Slight modifications to the Groups.pm worked great... Except for 1 thing. Once I make a CF source be my new module inside the CF, I can't change it back to Provide List... It just goes back to CF display unchanged. Is changing the CF data source a 1 way operation? RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
Re: [rt-users] Strip the requestor
Looks like it's probably moving queues and not getting to the SetRequestor. I had this happen to me on a scrip too. Think it's firing off the change queue event before it finishes the rest of your scrip. Maybe reverse order of operations or break it into 2 scrips, possible putting the SetRequestor as an On Queue Change TransactionCreate scrip on the Contact Us queue... From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Randy Black Sent: Wednesday, January 04, 2012 3:11 PM To: Randy Black; rt-users@lists.bestpractical.com Subject: Re: [rt-users] Strip the requestor Anyone? Need to strip the requestor on create for a specific queue. Thanks, Randy From: rt-users-boun...@lists.bestpractical.commailto:rt-users-boun...@lists.bestpractical.com [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Randy Black Sent: Wednesday, January 04, 2012 2:01 PM To: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com Subject: [rt-users] Strip the requestor I need to strip the requestor from tickets belonging to a queue. How do I do that? This seems to not be working: my $newqueue = Contact\ Us; my $newrequestor = nobody; my $T_Obj = $self-TicketObj; $RT::Logger-info(Auto assign ticket #. $T_Obj-id . to queue #. $newqueue ); my ($status, $msg) = $T_Obj-SetQueue($newqueue); unless ($status) { $RT::Logger-warning(unable to set new queue: $msg); return undef; } $RT::Logger-info(Auto assign ticket #. $T_Obj-id . to user #. $newrequestor ); my ($status, $msg) = $self-TicketObj-SetRequestor( $newrequestor ); unless( $status ) { $RT::Logger-error( Impossible to assign the ticket to $newrequestor: $msg ); return undef; } return 1; RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
Re: [rt-users] CustomField that displays users
That's what a User-defined Group is. It is a subset of Privileged users that you put in as members. Yeah, I have those. Everyone I want to display is in a group I've defined, but I didn't want to assume I could populate on groups. I have some code that will put all members of a group into a Custom Field. That would be awesome if you could share. I was a little surprised I wasn't able to find anyone asking about it via my searches. I would have thought it would be somewhat common. Thanks! Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
[rt-users] CustomField that displays users
Is there a way to have a custom field be a pre-filled dropdown of all the current privileged users? A subset would be even better - like members of a specific group or something unique in their user profile (like extra info = QA Dept or something). Thanks! Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
Re: [rt-users] Error running rt-validator
Circumstances : I've got a clean install of 4.0.4, bringing in a DB from 3.8.7 I import the mysql dump I made, run the vulnerable passwords, shrink-transactions and shrink cgm scripts, but when I check with validator, I get that error. Any suggestions? Did you run the DB upgrade scripts? RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
Re: [rt-users] Shredder - some tips
snip This is going to shred about 30,000 tickets, and a huge number of Users. Does the shredding have to be done on a quiet system? I've shred a few tickets while we were live without issue... I'm just worried that I kick off a process to shred a large volume and it chokes my server out. Any experience/input is appreciated. You can limit the number of tickets it shreds with the ; limit, x in the plugins line. Ie: --plugin Tickets=query,Status='deleted';limit,0 Limit of 0 means everything. But you could set that to 100 or 1000 and see how it affects your system and then make the call on how many to shred at a time. Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
[rt-users] Looping through transactionobj
I have a scrip that checks to see if the value of certain customfield value has changed. If so, it sets the value of a different custom field. I want to expand it to check if the value of another customfield has changed and if so, set the value of a 4th custom field. So: If CF1 changed, set CF2 to hi and/or If CF3 changed, set CF4 to bye The scrip works fine if either CF1 or CF3 is changed, but if BOTH are changed, it's only setting CF4. I suspect I'm only catching the highest CF ID number - the last in the set. I have some other CF's on the ticket that have ID's higher than CF1, but lower than CF3 (just the way they got added into the system) and the same thing happens if I change the value of one of them and CF1 - CF2 doesn't get changed, but CF3/CF4 works. How do I loop through the TransactionObj to make sure I pick up all the changes? I can sort out the non-CF1/3 changes with an IF, but I can't figure out how to get my while statement right... I've tried this: my $trans = $self-TransactionObj; while (my $customtrans = $trans-Next){ ... } and while (my $customtrans = $trans-Next()){ ... } But I get: RT: Scrip 27 Prepare failed: RT::Transaction::Next Unimplemented in RT::Action::UserDefined. I've tried: my $cffields = $self-TransactionObj -CustomField; Got: RT: Scrip 27 Prepare failed: RT::Transaction::CustomField Unimplemented in RT::Action::UserDefined. Tried: my $cffields = $trans-Field; while (my $customtrans = $ cffields -Next()){ ... } Got: Scrip 27 Prepare failed: Can't call method Next without a package or object reference at (eval 3099) line 24 Thanks, Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
[rt-users] CustomField value is reset or deleted back to prior value in scrip
I have 4 custom fields in this scenario: 1st Approval 2nd Approval Those are both Select One Value dropdowns that apply to tickets. Permissions are view for Privileged and modify for a group allowed to approve these tickets. I have 2 additional fields: 1st Approved By 2nd Approved By Both are Enter one value that apply to tickets. Privileged has view and there are no other permissions set (I don't want users able to set this field, essentially read only - you'll see why in a minute). If an approver makes a selection in one of the select boxes, I have scrip that will enter a value in the corresponding approved by field. Here's the weird thing - it works perfect for the 1st boxes. But when I choose a value for the 2nd approval, it sets it, then reverts it back to the previous value (I've tried modifying the field as a superuser to confirm its rolling back and not just deleting the value). The scrip code from the 1st check/set was copy/pasted and only the variables changed to reflect the different column ids. Here is the snippet from the ticket history: Fri Dec 02 09:35:37 2011 Brent Wiese - (CC) 2nd Approval No changed to Yes Fri Dec 02 09:35:37 2011 The RT System itself - (CC) Seconded By Approved by: Brent Wiese added Fri Dec 02 09:35:37 2011 Brent Wiese - (CC) Seconded By Approved by: Brent Wiese deleted Scrip: Condition: User Defined Action: User Defined Template: Global template: Blank Stage: TransactionCreate Custom condition: unless ($self-TransactionObj-Type eq CustomField ) { return 0; } 1; Prep: # Set Field to ID of (CC) 1st Approval: my $CFid = 5; # Set to ID of (CC) 1st Approved By: my $CFAppID = 18; # Set Field to ID of (CC) 2nd Approval: my $CFid2 = 17; # Set to ID of (CC) 2nd Approved By: my $CFAppID2 = 20; # Set to 1 if you want an extra line that the scrip made changes logged in the ticket history my $rec = 1; my $cf_obj = RT::CustomField-new($RT::SystemUser); my $trans = $self-TransactionObj; my $ticket = $self-TicketObj; my $person = $trans-CreatorObj-RealName; if ( $self-TransactionObj-Type eq CustomField $self-TransactionObj-Field == $CFid ) { $cf_obj-LoadByName( Name = $CFAppID ); my $val = $ticket-FirstCustomFieldValue($CFid); if ($val eq 'Yes') { $ticket-AddCustomFieldValue(Field = $cf_obj, Value = Approved by: $person, RecordTransaction = $rec ); } elsif ($val eq 'No') { $ticket-AddCustomFieldValue(Field = $cf_obj, Value = Disapproved by: $person, RecordTransaction = $rec ); } else { $ticket-AddCustomFieldValue(Field = $cf_obj, Value = Pending, RecordTransaction = $rec ); } } if ( $self-TransactionObj-Type eq CustomField $self-TransactionObj-Field == $CFid2 ) { $cf_obj-LoadByName( Name = $CFAppID2 ); my $val2 = $ticket-FirstCustomFieldValue($CFid2); if ($val2 eq 'Yes') { $ticket-AddCustomFieldValue(Field = $cf_obj, Value = Approved by: $person, RecordTransaction = $rec ); } elsif ($val2 eq 'No') { $ticket-AddCustomFieldValue(Field = $cf_obj, Value = Disapproved by: $person, RecordTransaction = $rec ); } else { $ticket-AddCustomFieldValue(Field = $cf_obj, Value = Pending, RecordTransaction = $rec ); } } return 1; -- I've tried return 0 here too and no difference No cleanup. It was working this way before I added the $cf_obj variable. I thought maybe hard-coding it to enter the value as RT_System would help, but it made no difference. I tried doing all the code in the custom condition (which is why I'm still checking if it's a customfield transaction in the if statement). Works the same either way I try it. Any thoughts? Thanks, Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Boston March 5 6, 2012
Re: [rt-users] CustomField value is reset or deleted back to prior value in scrip
I'd tried TransactionBatch previously when I was doing a lot of logging and I noticed it was creating 2 log entries for every ticket update. When I switched to TransactionCreate it only logged once, so I figured that's the one I wanted. However, you were right, changing to TransactionBatch worked. Why it worked on 1 of the CF changes and not the other... who knows. But it's now brought up another couple issues: 1: If I change the value of BOTH approved CF's and update the ticket, the scrip is only catching the 2nd approval field and updating its approved by field. I'm logging inside of each if statement and I'm only seeing the log entry in the second if. It should be passing both if statements and making the necessary changes. So either one works individually, but when changing both, only the second gets caught. 2: If I find both approvals are yes and the approved by CF's match, then I set the ticket stalled. That works fine. However, if I go back into display and change the status to open and one of the approval fields to no, it doesn't change the approved by field (it does reopen the ticket and retain the no choice.) In order to catch both CF and Status updates, I changed the condition code to this: unless (($self-TransactionObj-Type eq CustomField ) || ($self-TransactionObj-Type eq Status )) { $RT::Logger-info(Made it into condition); return 0; } 1; Any idea why that would happen? From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Kenneth Crocker Sent: Friday, December 02, 2011 11:41 AM To: RT User List Subject: Re: [rt-users] CustomField value is reset or deleted back to prior value in scrip Brent, Without looking at your code, I can tell you that you should make the stage TransactionBatch (be sure to turn that on in your RT_SiteConfig.pm file). Try and see if that works. Kenn On Fri, Dec 2, 2011 at 8:49 AM, Brent Wiese bwi...@elementps.commailto:bwi...@elementps.com wrote: I have 4 custom fields in this scenario: 1st Approval 2nd Approval Those are both Select One Value dropdowns that apply to tickets. Permissions are view for Privileged and modify for a group allowed to approve these tickets. I have 2 additional fields: 1st Approved By 2nd Approved By Both are Enter one value that apply to tickets. Privileged has view and there are no other permissions set (I don't want users able to set this field, essentially read only - you'll see why in a minute). If an approver makes a selection in one of the select boxes, I have scrip that will enter a value in the corresponding approved by field. Here's the weird thing - it works perfect for the 1st boxes. But when I choose a value for the 2nd approval, it sets it, then reverts it back to the previous value (I've tried modifying the field as a superuser to confirm its rolling back and not just deleting the value). The scrip code from the 1st check/set was copy/pasted and only the variables changed to reflect the different column ids. Here is the snippet from the ticket history: Fri Dec 02 09:35:37 2011 Brent Wiese - (CC) 2nd Approval No changed to Yes Fri Dec 02 09:35:37 2011 The RT System itself - (CC) Seconded By Approved by: Brent Wiese added Fri Dec 02 09:35:37 2011 Brent Wiese - (CC) Seconded By Approved by: Brent Wiese deleted Scrip: Condition: User Defined Action: User Defined Template: Global template: Blank Stage: TransactionCreate Custom condition: unless ($self-TransactionObj-Type eq CustomField ) { return 0; } 1; Prep: # Set Field to ID of (CC) 1st Approval: my $CFid = 5; # Set to ID of (CC) 1st Approved By: my $CFAppID = 18; # Set Field to ID of (CC) 2nd Approval: my $CFid2 = 17; # Set to ID of (CC) 2nd Approved By: my $CFAppID2 = 20; # Set to 1 if you want an extra line that the scrip made changes logged in the ticket history my $rec = 1; my $cf_obj = RT::CustomField-new($RT::SystemUser); my $trans = $self-TransactionObj; my $ticket = $self-TicketObj; my $person = $trans-CreatorObj-RealName; if ( $self-TransactionObj-Type eq CustomField $self-TransactionObj-Field == $CFid ) { $cf_obj-LoadByName( Name = $CFAppID ); my $val = $ticket-FirstCustomFieldValue($CFid); if ($val eq 'Yes') { $ticket-AddCustomFieldValue(Field = $cf_obj, Value = Approved by: $person, RecordTransaction = $rec ); } elsif ($val eq 'No') { $ticket-AddCustomFieldValue(Field = $cf_obj, Value = Disapproved by: $person, RecordTransaction = $rec ); } else { $ticket-AddCustomFieldValue(Field = $cf_obj, Value = Pending, RecordTransaction = $rec ); } } if ( $self-TransactionObj-Type
Re: [rt-users] Scrip to check who updated a CustomField
On Wed, Nov 16, 2011 at 03:35:09PM -0700, Brent Wiese wrote: I have scrips that will check the value of a custom field and perform actions based on it. But what I can't seem to figure out is how to show who made the custom field change. Specifically, I'm trying to compare who updated 2 custom fields. I have a case where I have a group of users allowed to change these 2 fields, but the same user isn't allowed to change both. So I need to compare who changed the 2 fields, and if they're the same user, perform an action (ie: set ticket stalled or email adminCC's or whatever). I'm pretty new to object oriented programming (especially under Perl), but it looks like I should be able to check LastUpdatedBy; I'm just not sure how. I suspect you want the Transaction object's CreatorObj which will be the user who made the change. Transactions don't tend to be updated, so LastUpdatedByObj should be the same as CreatorObj -kevin I'm not sure that would work. The case could be like this: User A selects a value for Field1 User B selects a value for Field2 User A reselects a value for Field2 If I understand what you've said, then my test would pass because the values were initially chosen (created) by different users. But I really want the above to fail. Or is that CreatorObj new every time the transaction happens? -Brent RT Training Sessions (http://bestpractical.com/services/training.html) * Barcelona, Spain November 28 29, 2011
[rt-users] Scrip to check who updated a CustomField
I have scrips that will check the value of a custom field and perform actions based on it. But what I can't seem to figure out is how to show who made the custom field change. Specifically, I'm trying to compare who updated 2 custom fields. I have a case where I have a group of users allowed to change these 2 fields, but the same user isn't allowed to change both. So I need to compare who changed the 2 fields, and if they're the same user, perform an action (ie: set ticket stalled or email adminCC's or whatever). I'm pretty new to object oriented programming (especially under Perl), but it looks like I should be able to check LastUpdatedBy; I'm just not sure how. Thanks! RT Training Sessions (http://bestpractical.com/services/training.html) * Barcelona, Spain November 28 29, 2011