[rt-users] problem in scrip when ticket is created via REST request
Hi, I've been asked to create a scrip to act on a ticket based on a custom field set at creation time. This scrip must also add a 'refers to' value to the ticket being created. I wrote the scrip, (it compiles) but it's not working and I'm getting the following log message: """ RT: [4954] This login session belongs to a REST client, and cannot be used to#012access non-REST interfaces of RT for security reasons.#012 (Please log out and back in to obtain a session for normal browsing. If#012you understand the security implications, disabling RT's CSRF protection#012will remove this restriction.) """ This happens even if I set this value: Set($RestrictReferrer, 0); Am I doing something wrong? Any help will be greatly appreciated -- Regards, Hugo Escobar <http://www.associationfinancialservices.com/> 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> <http://www.linkedin.com/companies/1006276> NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* - RT 4.4 and RTIR training sessions, and a new workshop day! https://bestpractical.com/training * Boston - October 24-26 * Los Angeles - Q1 2017
Re: [rt-users] stop form submit on ticket reply
Thanks Emmanuel for your response. My initial post was a little inaccurate, I forgot to mention some details: 1.The user wants to add a ticket reply 2.The user writes (and prepares her message, attachments, etc) 3.The user presses the "Update Ticket", some condition is evaluated two possible outcomes (true, false) 3.1 If false => submit reply 3.2 If true => the user is asked if the reply should be submitted 3.2.1 User wants to continue => reply submitted 3.2.2 User decides to abort reply submission => no ticket reply should be added I tried to implement something in javascript to handle "3.2.2" but the reply is always submitted I'm thinking now in a variation of your proposed solution. Perhaps bouncing the ticket reply including an 'onload' javascript alert for steps 3.2.1 of 3.2.2 On Tue, Aug 23, 2016 at 6:22 PM, Emmanuel Lacour <elac...@easter-eggs.com> wrote: > Le 23/08/2016 à 22:59, Hugo Escobar a écrit : > > Hi, > > > > I need to be able to stop submitting a "Public Reply" correspondence > > based on a evaluation that returns a Boolean value. > > > > This decision must be taken when the user clicks the "Update Ticket" > button > > > > Everything I have tried fails because the form is always submitted. > > > > Any help will be highly appreciated > > > > > > create a file named > /rt/local/html/Callbacks/YourOrg/Ticket/Update.html/BeforeUpdate > > with a content such as: > > <%init> > > if ( exists $ARGSRef->{SubmitTicket} ) { > # Write here your evaluation, you can use submitted values in > %$ARGSRef and the ticket object $TicketObj > if ( !$evaluation ) { > push @$results, loc("Message that should be displayed to > user"); > $$skip_update = 1; > } > } > > <%args> > $TicketObj => undef > $skip_update => undef > $results => undef > $ARGSRef => undef > > > > don't forget to cleanup your mason cache and restart your webserver. > - > RT 4.4 and RTIR training sessions, and a new workshop day! > https://bestpractical.com/training > * Boston - October 24-26 > * Los Angeles - Q1 2017 > -- Regards, Hugo Escobar <http://www.associationfinancialservices.com/> 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> <http://www.linkedin.com/companies/1006276> NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* - RT 4.4 and RTIR training sessions, and a new workshop day! https://bestpractical.com/training * Boston - October 24-26 * Los Angeles - Q1 2017
[rt-users] stop form submit on ticket reply
Hi, I need to be able to stop submitting a "Public Reply" correspondence based on a evaluation that returns a Boolean value. This decision must be taken when the user clicks the "Update Ticket" button Everything I have tried fails because the form is always submitted. Any help will be highly appreciated -- Regards, Hugo Escobar <http://www.associationfinancialservices.com/> 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> <http://www.linkedin.com/companies/1006276> NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* - RT 4.4 and RTIR training sessions, and a new workshop day! https://bestpractical.com/training * Boston - October 24-26 * Los Angeles - Q1 2017
Re: [rt-users] Stuck in Login page
Update: I'm running the standalone http server as indicated here: http://kb.mit.edu/confluence/display/istcontrib/How+to+run+a+Request+Tracker+server+instance+in+standalone+mode+for+troubleshooting and got the following output in debug.log: [Tue Aug 2 19:57:43 2016] [info]: Successful login for root from 127.0.0.1 (/path/to/rt/sbin/../lib/RT/Interface/Web.pm:831) [Tue Aug 2 19:57:43 2016] [debug]: SQL(0.001227s): SELECT main.* FROM Attributes main WHERE (main.ObjectId = 1) AND (main.ObjectType = 'RT::System') ORDER BY main.id ASC ; (/path/to/rt/sbin/../lib/RT/Interface/Web.pm:1308) [Tue Aug 2 19:57:43 2016] [debug]: SQL(0.000672s): SELECT * FROM Users WHERE Name = ?; [ bound values: 'root' ] (/path/to/rt/sbin/../lib/RT/Interface/Web.pm:1308) [Tue Aug 2 19:57:43 2016] [debug]: SQL(0.000583s): SELECT * FROM Principals WHERE id = ?; [ bound values: '12' ] (/path/to/rt/sbin/../lib/RT/Interface/Web.pm:1308) [Tue Aug 2 19:57:43 2016] [debug]: SQL(0.001327s): SELECT main.* FROM Attributes main WHERE (main.ObjectId = 1) AND (main.ObjectType = 'RT::System') ORDER BY main.id ASC ; (/path/to/rt/sbin/../lib/RT/Interface/Web.pm:1308) [Tue Aug 2 19:57:44 2016] [debug]: SQL(0.002197s): SELECT main.* FROM Attributes main WHERE (main.ObjectId = 1) AND (main.ObjectType = 'RT::System') ORDER BY main.id ASC ; (/path/to/rt/sbin/../lib/RT/Interface/Web.pm:1308) [Tue Aug 2 19:57:44 2016] [debug]: SQL(0.001655s): SELECT main.* FROM Attributes main WHERE (main.ObjectId = 1) AND (main.ObjectType = 'RT::System') ORDER BY main.id ASC ; (/path/to/rt/sbin/../lib/RT/Interface/Web.pm:1308) it looks like it works ok at least to a point in which it decides to redirect the user to the login page. Nothing in log files (apache,rt) seems to indicate a problem On Tue, Aug 2, 2016 at 1:57 PM, Hugo Escobar <hesco...@afslc.com> wrote: > Hi, > > We are in the process of upgrading rt to 4.4.1 > > I'm having a problem with my local instance. I cannot go beyond the login > page. Note the following lines in the apache logs. The first two lines (in > blue) appear when it works ok > > - - [02/Aug/2016:13:39:45 -0400] "POST /NoAuth/Login.html > HTTP/1.1" 302 - > - - [02/Aug/2016:13:39:45 -0400] "GET / HTTP/1.1" 200 6979 > - - [02/Aug/2016:13:39:45 -0400] "GET > /NoAuth/Login.html?next=f7662257268ca40cca1dc91310117c47 HTTP/1.1" 200 6993 > - - [02/Aug/2016:13:39:45 -0400] "GET > /NoAuth/Login.html?next=982ee72957d160bd2a07b3a938d2fa79 HTTP/1.1" 200 6993 > (...) > > > It looks like it's not an authentication problem (from rt logs): > [3778] [Tue Aug 2 17:39:45 2016] [info]: Successful login for root from > (/path/to/rt-4.4.1/sbin/../lib/RT/Interface/Web.pm:831) > > I've done all those basic debugging procedures like erasing browser > cookies, restarting apache erasing the mason cache, etc and nothing seems > to work. Google searches haven't given me anything useful either > > Any help will be highly appreciated > > -- > Regards, > > Hugo Escobar > > <http://www.associationfinancialservices.com/> > > 4770 Biscayne Blvd, Ste 700 > Miami, FL 33137 > > main: 305.677.0022 > support: 305.921.4620 > email: hesco...@afslc.com > > Follow us on Facebook and Linked-In > <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> ><http://www.linkedin.com/companies/1006276> > > NOTICE: This email and any attachment to this email may contain > confidential information. If you are not the intended recipient, you must > not review, retransmit, convert to hard copy, photocopy, use or disseminate > this email or any attachments to it. If you have received this email in > error, please notify us immediately by return email and delete this > message. Please note that if this email contains a forwarded message or is > a reply to a prior message, some or all of the contents of this message or > any attachments may not have been produced by our firm. *As our firm may > be deemed a debt collector, if your payment is in default, we may be > attempting to collect a debt on behalf of the association, and any > information obtained may be used for that purpose.* > -- Regards, Hugo Escobar <http://www.associationfinancialservices.com/> 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> <http://www.linkedin.com/companies/1006276> NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have rece
[rt-users] Stuck in Login page
Hi, We are in the process of upgrading rt to 4.4.1 I'm having a problem with my local instance. I cannot go beyond the login page. Note the following lines in the apache logs. The first two lines (in blue) appear when it works ok - - [02/Aug/2016:13:39:45 -0400] "POST /NoAuth/Login.html HTTP/1.1" 302 - - - [02/Aug/2016:13:39:45 -0400] "GET / HTTP/1.1" 200 6979 - - [02/Aug/2016:13:39:45 -0400] "GET /NoAuth/Login.html?next=f7662257268ca40cca1dc91310117c47 HTTP/1.1" 200 6993 - - [02/Aug/2016:13:39:45 -0400] "GET /NoAuth/Login.html?next=982ee72957d160bd2a07b3a938d2fa79 HTTP/1.1" 200 6993 (...) It looks like it's not an authentication problem (from rt logs): [3778] [Tue Aug 2 17:39:45 2016] [info]: Successful login for root from (/path/to/rt-4.4.1/sbin/../lib/RT/Interface/Web.pm:831) I've done all those basic debugging procedures like erasing browser cookies, restarting apache erasing the mason cache, etc and nothing seems to work. Google searches haven't given me anything useful either Any help will be highly appreciated -- Regards, Hugo Escobar <http://www.associationfinancialservices.com/> 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> <http://www.linkedin.com/companies/1006276> NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* - RT 4.4 and RTIR Training Sessions https://bestpractical.com/training * Los Angeles - September, 2016
Re: [rt-users] error "could not find component" - upgrading to 4.4.0
nevermind, the problem was solved by updating /Ticket/Update.html Thanks On Mon, Jun 27, 2016 at 1:16 PM, Hugo Escobar <hesco...@afslc.com> wrote: > Hi, > > We are upgrading from 4.2.9 to 4.4.0 > > The error in the attached image results when attempting to upgrade a > ticket, > > url: > http://ticket/Ticket/Update.html?Action=Respond=rejected=833 > > Remarks: > 1.- A file with the same name exists in another location: > > $ find . -name 'ShowSimplifiedRecipients' > ./share/html/Helpers/ShowSimplifiedRecipients > > $ ls -l Helpers/ShowSimplifiedRecipients > -rw-r--r-- 1 root bin 6277 Jun 20 14:15 Helpers/ShowSimplifiedRecipients > > 2.- No error messages or any clue in log files about what could be > happening > > 3.- There is no customization of such component in 'local/html' > > > [image: Inline image 1] > > Any help will be appreciated > > -- > Regards, > > Hugo Escobar > > <http://www.associationfinancialservices.com/> > > 4770 Biscayne Blvd, Ste 700 > Miami, FL 33137 > > main: 305.677.0022 > support: 305.921.4620 > email: hesco...@afslc.com > > Follow us on Facebook and Linked-In > <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> ><http://www.linkedin.com/companies/1006276> > > NOTICE: This email and any attachment to this email may contain > confidential information. If you are not the intended recipient, you must > not review, retransmit, convert to hard copy, photocopy, use or disseminate > this email or any attachments to it. If you have received this email in > error, please notify us immediately by return email and delete this > message. Please note that if this email contains a forwarded message or is > a reply to a prior message, some or all of the contents of this message or > any attachments may not have been produced by our firm. *As our firm may > be deemed a debt collector, if your payment is in default, we may be > attempting to collect a debt on behalf of the association, and any > information obtained may be used for that purpose.* > -- Regards, Hugo Escobar <http://www.associationfinancialservices.com/> 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> <http://www.linkedin.com/companies/1006276> NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* - RT 4.4 and RTIR Training Sessions https://bestpractical.com/training * Los Angeles - September, 2016
[rt-users] error "could not find component" - upgrading to 4.4.0
Hi, We are upgrading from 4.2.9 to 4.4.0 The error in the attached image results when attempting to upgrade a ticket, url: http://ticket/Ticket/Update.html?Action=Respond=rejected=833 Remarks: 1.- A file with the same name exists in another location: $ find . -name 'ShowSimplifiedRecipients' ./share/html/Helpers/ShowSimplifiedRecipients $ ls -l Helpers/ShowSimplifiedRecipients -rw-r--r-- 1 root bin 6277 Jun 20 14:15 Helpers/ShowSimplifiedRecipients 2.- No error messages or any clue in log files about what could be happening 3.- There is no customization of such component in 'local/html' [image: Inline image 1] Any help will be appreciated -- Regards, Hugo Escobar <http://www.associationfinancialservices.com/> 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> <http://www.linkedin.com/companies/1006276> NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* - RT 4.4 and RTIR Training Sessions https://bestpractical.com/training * Los Angeles - September, 2016
Re: [rt-users] remove large attachments and replace with download link
Thank for your comments and suggestions. We decided to upgrade RT to 4.4 On Wed, Jun 8, 2016 at 3:11 AM, Christian Loos <cl...@netcologne.de> wrote: > Am 07.06.2016 um 23:23 schrieb Hugo Escobar: > > We need to give our users the possibility of receiving large files (say > >> 10MB) > > > > Knowing the attachment size limit all email services impose, we thought > > there should be a way to tell RT to replace large attachments with a > > download > > link when constructing the email message allowing the user to access > those > > files. > > > > I've been searching the internet to no avail. > > > > Any help will be appreciated > > This is possible in RT 4.4 if you use ExternalStorage Type "AmazonS3" > [1] and activate the "Direct Linking" feature [2]. > > Chris > > [1] > https://docs.bestpractical.com/rt/latest/RT_Config.html#External-storage > [2] > > https://docs.bestpractical.com/rt/latest/RT/ExternalStorage/AmazonS3.html#Direct-Linking > -- Regards, Hugo Escobar <http://www.associationfinancialservices.com/> 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> <http://www.linkedin.com/companies/1006276> NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* - RT 4.4 and RTIR Training Sessions https://bestpractical.com/training * Los Angeles - September, 2016
[rt-users] remove large attachments and replace with download link
We need to give our users the possibility of receiving large files (say > 10MB) Knowing the attachment size limit all email services impose, we thought there should be a way to tell RT to replace large attachments with a download link when constructing the email message allowing the user to access those files. I've been searching the internet to no avail. Any help will be appreciated -- Regards, Hugo Escobar <http://www.associationfinancialservices.com/> 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> <http://www.linkedin.com/companies/1006276> NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* - RT 4.4 and RTIR Training Sessions https://bestpractical.com/training * Los Angeles - September, 2016
Re: [rt-users] scrip to detect attached zip files
Update: The following lines work exactly as I expect: use Data::Dumper; my $tobj = $self->TransactionObj; my $atts = $tobj->Attachments; my $attachment = $self->TransactionObj->Attachments->Next; if (!$attachment) { return 0; } my $content = Dumper($attachment->ContentAsMIME(Children=>1)); if ($content=~/ name\=\".*?\.zip\"/i) { $RT::Logger->info("message has a zip file"); } else { $RT::Logger->info("no zip file"); } return 1; However, this doesn't look like a good solution In an attempt to use the API directly, I tried the following: https://docs.bestpractical.com/rt/4.2.12/RT/Attachment.html#Filename https://docs.bestpractical.com/rt/4.2.12/RT/Transaction.html#Attachments while(my $attachment = $self->TransactionObj->Attachments->Next) { $RT::Logger->info($attachment->FileName); } But got this in the log file: [Wed Mar 16 16:47:07 2016] [error]: Scrip 34 Commit failed: RT::Attachment::FileName Unimplemented in RT::Action::UserDefined. ((eval 652) line 2) any ideas? Thanks in advance PS: our installation: Centos 6.6/MySql/Apache+mod_perl RT 4.2.9 On Tue, Mar 15, 2016 at 7:04 PM, Hugo Escobar <hesco...@afslc.com> wrote: > Hi, > > I need to detect if a zip file has been attached to a ticket at > creation time and also at 'comment' or 'correspond' time. > > My idea to solve this is to extract the attachments and then parse > the content. > > I think the best route for this would be: > > TransactionObj->Attachments->Next ... > ContentAsMIME(Children=>1) > > Since MIME entities can themselves contain other entities, > I think I'm going to need a recursive function ... > > Basically what I'd like is a few words of advice. I think I can > come up with a solution but perhaps there's a simpler path I'm overlooking > or I'm not aware of. > > Thanks in advance, > -- Regards, Hugo Escobar <http://www.associationfinancialservices.com/> 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> <http://www.linkedin.com/companies/1006276> NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* - RT 4.4 and RTIR Training Sessions https://bestpractical.com/training * Washington DC - May 23 & 24, 2016
Re: [rt-users] scrip to detect attached zip files
Thanks Jannae, it works like a charm! On Wed, Mar 16, 2016 at 10:11 PM, Jannae Jacks <jan...@nyu.edu> wrote: > Hi Hugo, > > The N in Filename is not capitalized in the docs. Try lowercase? > > ttps://docs.bestpractical.com/rt/4.4.0/RT/Attachment.html#Filename > > Like so: > > while(my $attachment = $self->TransactionObj->Attachments->Next) { > $RT::Logger->info($attachment->Filename); > } > > > > On Wed, Mar 16, 2016 at 1:01 PM, Hugo Escobar <hesco...@afslc.com> wrote: > >> Update: >> The following lines work exactly as I expect: >> >> use Data::Dumper; >> >> my $tobj = $self->TransactionObj; >> my $atts = $tobj->Attachments; >> >> my $attachment = $self->TransactionObj->Attachments->Next; >> if (!$attachment) { >> return 0; >> } >> >> my $content = Dumper($attachment->ContentAsMIME(Children=>1)); >> if ($content=~/ name\=\".*?\.zip\"/i) { >> $RT::Logger->info("message has a zip file"); >> } else { >> $RT::Logger->info("no zip file"); >> } >> return 1; >> >> However, this doesn't look like a good solution >> >> >> In an attempt to use the API directly, I tried the following: >> >> https://docs.bestpractical.com/rt/4.2.12/RT/Attachment.html#Filename >> https://docs.bestpractical.com/rt/4.2.12/RT/Transaction.html#Attachments >> >> while(my $attachment = $self->TransactionObj->Attachments->Next) { >> $RT::Logger->info($attachment->FileName); >> } >> >> But got this in the log file: >> >> [Wed Mar 16 16:47:07 2016] [error]: Scrip 34 Commit failed: >> RT::Attachment::FileName Unimplemented in RT::Action::UserDefined. ((eval >> 652) line 2) >> >> any ideas? >> >> Thanks in advance >> >> PS: >> our installation: >> Centos 6.6/MySql/Apache+mod_perl >> RT 4.2.9 >> >> >> On Tue, Mar 15, 2016 at 7:04 PM, Hugo Escobar <hesco...@afslc.com> wrote: >> >>> Hi, >>> >>> I need to detect if a zip file has been attached to a ticket at >>> creation time and also at 'comment' or 'correspond' time. >>> >>> My idea to solve this is to extract the attachments and then parse >>> the content. >>> >>> I think the best route for this would be: >>> >>> TransactionObj->Attachments->Next ... >>> ContentAsMIME(Children=>1) >>> >>> Since MIME entities can themselves contain other entities, >>> I think I'm going to need a recursive function ... >>> >>> Basically what I'd like is a few words of advice. I think I can >>> come up with a solution but perhaps there's a simpler path I'm >>> overlooking or I'm not aware of. >>> >>> Thanks in advance, >>> >> >> >> >> -- >> Regards, >> >> Hugo Escobar >> >> <http://www.associationfinancialservices.com/> >> >> 4770 Biscayne Blvd, Ste 700 >> Miami, FL 33137 >> >> main: 305.677.0022 >> support: 305.921.4620 >> email: hesco...@afslc.com >> >> Follow us on Facebook and Linked-In >> <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> >><http://www.linkedin.com/companies/1006276> >> >> NOTICE: This email and any attachment to this email may contain >> confidential information. If you are not the intended recipient, you must >> not review, retransmit, convert to hard copy, photocopy, use or disseminate >> this email or any attachments to it. If you have received this email in >> error, please notify us immediately by return email and delete this >> message. Please note that if this email contains a forwarded message or is >> a reply to a prior message, some or all of the contents of this message or >> any attachments may not have been produced by our firm. *As our firm may >> be deemed a debt collector, if your payment is in default, we may be >> attempting to collect a debt on behalf of the association, and any >> information obtained may be used for that purpose.* >> >> - >> RT 4.4 and RTIR Training Sessions https://bestpractical.com/training >> * Washington DC - May 23 & 24, 2016 >> >> > > > -- > Jannae Jacks > Senior Network Security Analyst, Technology Security Services > New York University, Information Technology > 726 Broadway, 2nd Floor, New York, NY 10003 > http://www.nyu.edu > > p: (212) 992.7444 | m: (901
[rt-users] scrip to detect attached zip files
Hi, I need to detect if a zip file has been attached to a ticket at creation time and also at 'comment' or 'correspond' time. My idea to solve this is to extract the attachments and then parse the content. I think the best route for this would be: TransactionObj->Attachments->Next ... ContentAsMIME(Children=>1) Since MIME entities can themselves contain other entities, I think I'm going to need a recursive function ... Basically what I'd like is a few words of advice. I think I can come up with a solution but perhaps there's a simpler path I'm overlooking or I'm not aware of. Thanks in advance, -- Regards, Hugo Escobar <http://www.associationfinancialservices.com/> 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In <http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864> <http://www.linkedin.com/companies/1006276> NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* - RT 4.4 and RTIR Training Sessions https://bestpractical.com/training * Washington DC - May 23 & 24, 2016
Re: [rt-users] web request from custom scrip
Hi Landon, For some reason the result is not being written in log files (I'll have to check my RT_SiteConfig.pm :) I parsed the response directly and I got what I needed. Thank you On Thu, Apr 2, 2015 at 2:55 PM, Landon Stewart lstew...@iweb.com wrote: On Apr 2, 2015, at 11:03 AM, Hugo Escobar hesco...@afslc.com wrote: Hi, I'm trying to write a scrip that sends a web request to an external server and depending on the answer set a specific priority level So far the web request goes out and the priority can be set. The only missing part is that I can't get a hold of the external web server response. Hi Hugo, Firstly - Does https://extwebserv/ have a real certificate? Try the following instead. I haven't tested it but basically it tries the URL and sets the priority if it was successful. It also logs the response message (a short human readable single line string that explains the response code) regardless of what it was. It returns whatever $status is (if it's set then it'll be non-zero). use LWP::UserAgent; my $url = 'https://extwebserv/'.somePieceOfData; RT::Logger-info(Ticket .$self-TicketObj-id. Checking .$url); my $ua = LWP::UserAgent-new; my $response = $ua-get($url); my ($status, $msg); # Set these up as empty for now ($status, $msg) = $self-TicketObj-SetPriority('100') if $response-is_success; RT::Logger-info(Ticket .$self-TicketObj-id. .$response-message); return $status; Landon Stewart : lstew...@iweb.com Lead Specialist, Abuse and Security Management Spécialiste principal, gestion des abus et sécurité http://iweb.com : +1 (888) 909-4932 -- Regards, Hugo Escobar http://www.associationfinancialservices.com/ 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 http://www.linkedin.com/companies/1006276 NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.*
[rt-users] web request from custom scrip
Hi, I'm trying to write a scrip that sends a web request to an external server and depending on the answer set a specific priority level So far the web request goes out and the priority can be set. The only missing part is that I can't get a hold of the external web server response. Following, a few lines that I wrote in the 'custom action commit' section: --- code require LWP::UserAgent; my $ua = LWP::UserAgent-new; my $url = 'https://extwebserv/'.somePieceOfData; my $response = $ua-get($url); if ($response-is_success) { # *FAILS!* RT::Logger-info($response-as_string); #decoded_content); my $newpriority = 100; my ($status, $msg) = $self-TicketObj-SetPriority($newpriority); unless ($status) { $RT::Logger-warning(unable to set new priority value); return undef; } return 1; } --- end code Any help will be highly appreciated -- Regards, Hugo Escobar http://www.associationfinancialservices.com/ 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 http://www.linkedin.com/companies/1006276 NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.*
[rt-users] user rights affecting custom fields access via REST requests
Hi there, Our RT instances have this basic conf: RT 4.2.9, CentOS 6.6, mysql Ver 14.14 Distrib 5.6.22, for Linux (x86_64) We are trying to restrict rights as much as possible for external users (those having access to RT via a custom web application.) In terms of group rights, this is what we would like to have: 1. Everyone- CreateTicket + ReplyToTicket 2. Privileged - None (empty) 3. Requestors - CreateTicket + ReplyToTicket + SeeCustomField + ShowTicket + ModifyCustomField + ModifyTicket However, these conf especially Privileged-None seems to be blocking access to custom fields. Doing a little research I found this: http://requesttracker.8502.n7.nabble.com/REST-API-and-WebExternal-Auth-td52611.html Is the user who is logging in via REST marked as Privileged in the admin UI? If not, they don't have access. You'll either need to allow Unprivileged users access in the config or mark your users Privileged. So, after marking external users as privileged I found that the configuration shown above still doesn't work, only after setting Privileged-SeeCustomField + ModifyCustomField Shouldn't the fact that users are 'Requestor' be enough to let them read/write custom fields? -- Regards, Hugo Escobar http://www.associationfinancialservices.com/ 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 http://www.linkedin.com/companies/1006276 NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.*
Re: [rt-users] email disabled for ticket
On Tue, Jun 17, 2014 at 3:16 PM, Kevin Falcone falc...@bestpractical.com wrote: On Fri, Jun 13, 2014 at 01:23:47PM -0400, Hugo Escobar wrote: I found this thread and have a few questions: Unfortunately, this thread appears to be unrelated to your problems. On Thu, Apr 10, 2014 at 12:46 PM, Kevin Falcone [1] falc...@bestpractical.com wrote: On Thu, Apr 10, 2014 at 02:26:19PM +, Edsall, William (WJ) wrote: Under `People' it says that the user (requestor)'s email is `disabled for ticket'. It says this just after his email address on the Requestors line. We would like that to happen on our end but don't know how to implement it. In our case, when a requestor is disabled it simply does not show that requestor under 'People' in Ticket/Display.html On the other hand, Ticket/ModifyPeople.html shows the disabled requestor but no indication about the status You're confusing a Disabled requestor with a Squelched requestor who has been configured to not receive mail for this ticket. In our case, the 'Modify who receives email ' section just shows this text: 'The checked users may receive email related to this ticket depending on the action taken. Uncheck users to stop sending email to them about this ticket.' but no checkboxes or any other input field ... Sys Info about our instance: OS: Centos6 RT version: 4.2.2 I tried everything in user's access control (on/off): - Let this user access RT, and - Let this user be granted rights (Privileged) I also browsed RT_Config up and down but nothing seems to control this particular behaviour or I'm missing something ... Guesses? You use only TransactionBatch scrips. You have no scrips or users that would get mail on that ticket. You do not have ShowOutgoingEmail. -kevin -- RT Training - Boston, September 9-10 http://bestpractical.com/training After doing a clean install of RT I saw the normal behaviour in RT which is to show 'disabled for ticket' when the email has been unchecked under the 'Modify who receives email ' section. At some point this stopped happening on my system. I managed to isolate the cause and it seems to be the database. Thanks for your help -- Regards, Hugo Escobar http://www.associationfinancialservices.com/ 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 http://www.linkedin.com/companies/1006276 NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* -- RT Training - Boston, September 9-10 http://bestpractical.com/training
Re: [rt-users] email disabled for ticket
Hi there: I found this thread and have a few questions: On Thu, Apr 10, 2014 at 12:46 PM, Kevin Falcone falc...@bestpractical.com wrote: On Thu, Apr 10, 2014 at 02:26:19PM +, Edsall, William (WJ) wrote: Under `People' it says that the user (requestor)'s email is `disabled for ticket'. It says this just after his email address on the Requestors line. We would like that to happen on our end but don't know how to implement it. In our case, when a requestor is disabled it simply does not show that requestor under 'People' in Ticket/Display.html On the other hand, Ticket/ModifyPeople.html shows the disabled requestor but no indication about the status What does this mean? Some replies did in fact work but at some point the system flagged his email as disabled for the ticket. Click on the People at the top of that tab (or at the top of the page) to get to the Modify People page. Scroll down and see the 'Modify who receives mail' section. It's like the checkboxes on the reply page which squelch people for a single transaction, but this does it for the whole ticket. In our case, the 'Modify who receives email ' section just shows this text: 'The checked users may receive email related to this ticket depending on the action taken. Uncheck users to stop sending email to them about this ticket.' but no checkboxes or any other input field ... Sys Info about our instance: OS: Centos6 RT version: 4.2.2 I tried everything in user's access control (on/off): - Let this user access RT, and - Let this user be granted rights (Privileged) I also browsed RT_Config up and down but nothing seems to control this particular behaviour or I'm missing something ... Any help will be highly appreciated -- Regards, Hugo Escobar http://www.associationfinancialservices.com/ 4770 Biscayne Blvd, Ste 700 Miami, FL 33137 main: 305.677.0022 support: 305.921.4620 email: hesco...@afslc.com Follow us on Facebook and Linked-In http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 http://www.linkedin.com/companies/1006276 NOTICE: This email and any attachment to this email may contain confidential information. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, photocopy, use or disseminate this email or any attachments to it. If you have received this email in error, please notify us immediately by return email and delete this message. Please note that if this email contains a forwarded message or is a reply to a prior message, some or all of the contents of this message or any attachments may not have been produced by our firm. *As our firm may be deemed a debt collector, if your payment is in default, we may be attempting to collect a debt on behalf of the association, and any information obtained may be used for that purpose.* -- RT Training - Boston, September 9-10 http://bestpractical.com/training
Re: [rt-users] problem with custom condition in scrip
Right, I wasn't getting the email address. it works now. Thanks On Thu, May 22, 2014 at 4:35 PM, Kevin Falcone falc...@bestpractical.comwrote: On Wed, May 21, 2014 at 10:12:03PM -0400, Hugo Escobar wrote: Hello, I've been attempting to instruct rt to send emails 'On Correspond' to 'Requestors' and 'Ccs', only if the email address of the user generating the transaction matches a predetermined list (@domain1 or @domain2) Following, the code I wrote for the 'custom condition': #--- begin code --- if ( $self-TransactionObj-Type ne 'Create' !grep { $self-CurrentUser-EmailAddress =~ /$_$/ } ('@domain1','@domain2') ) { return 0; } return 1; RT-Logger-error($self-CurrentUser-EmailAddress); to see what the email address is. It isn't who you think it is. You want $self-TransactionObj-CreatorObj-EmailAddress Your check of ne 'Create' is also sort of non-sensical since it'll apply to transactions such as setting a status or changing a CF. -kevin -- RT Training - Boston, September 9-10 http://bestpractical.com/training -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 -- RT Training - Boston, September 9-10 http://bestpractical.com/training
[rt-users] problem with custom condition in scrip
Hello, I've been attempting to instruct rt to send emails 'On Correspond' to 'Requestors' and 'Ccs', only if the email address of the user generating the transaction matches a predetermined list (@domain1 or @domain2) Following, the code I wrote for the 'custom condition': #--- begin code --- if ( $self-TransactionObj-Type ne 'Create' !grep { $self-CurrentUser-EmailAddress =~ /$_$/ } ('@domain1','@domain2') ) { return 0; } return 1; #-- end code -- This is the Basics section of the scrip: Description: On Correspond Notify Requestors and Ccs Condition: User Defined Action: Notify Requestors and Ccs Template: Correspondence Global Enabled Additionally, for testing purposes I took care of setting user@domain1 as a 'requestor' I've tested the code snippet on a regular perl script and it works 100% of the time, however RT is not doing what I need. Any help will be highly appreciated -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 -- RT Training - Boston, September 9-10 http://bestpractical.com/training
[rt-users] MakeClicky callback issue
Hi there: I've been writing some customization for makeclicky. We need to process our own 'link type' Everything works fine if I add the new code as a customized component in $RT/local/html/Elements/MakeClicky However, I would like to use the hook/callback but so far it has been ignored by RT I've tried the following places/names: $RT/local/html/Callbacks/Elements/MakeClicky $RT/local/html/Callbacks/SomeDir/Elements/MakeClicky (and many others ...) I'm almost sure it's a file name/location issue but nothing I've tried seems to work Thanks in advance -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 inline: facebook-24x24.pnginline: AFS_logo.pnginline: linkedin-24x24.png-- RT Training - Dallas May 20-21 http://bestpractical.com/training
Re: [rt-users] custom callback for ticket update not working after update 4.0.2 - 4.2.2
On Wed, Feb 5, 2014 at 10:23 AM, Kevin Falcone falc...@bestpractical.comwrote: On Tue, Feb 04, 2014 at 04:02:05PM -0500, Hugo Escobar wrote: $m-callback( Ticket = $TicketObj, ARGSRef = \%ARGS, checks_failure = \$checks_failure, results = \@results, CallbackName = 'Initial' ); which exists at the beginning of the %INIT section My implementation of this callback creates a MIME::Entity and adds the file to it, then it 'writes' the whole message to $session{'Attachments'} I've been trying to do the right changes for this to work under 4.2.2 but no luck so far You've not shown your code, so I'm guessing, but if you look at how 4.2 stores attachments in the session, it uses a token to finally fix the bug of creating two tickets simultaneously and accidentally attaching the wrong attachments to the wrong ticket. $session{Attachments}{$ARGS{Token}} Relevant code is in ProcessAttachments and you can also see it used in CreateTicket. This is what I do: my $Message = MIME::Entity-build( Type= 'multipart/mixed', Message-Id = RT::Interface::Email::GenMessageId, ); my ( $filehandle, @ar_content, $buffer ); open( $filehandle, , \$content ); while ( my $bytesread = read( $filehandle, $buffer, 4096 ) ) { push @ar_content, $buffer; } close $filehandle; $Message-attach( Filename = $doc_path, Type = 'application/pdf', Data = \@ar_content, ); # Attachment parts really shouldn't get a Message-ID $Message-head-delete('Message-ID'); $Message-make_singlepart; RT::I18N::SetMIMEEntityToUTF8($Message);# convert text parts into utf-8 $session{'Attachments'} = { %{$session{'Attachments'} || {}}, $key . '.pdf' = $Message }; (...) I changed the blue lines by the following: session{'Attachments'}{Digest::MD5::md5_hex(rand(1024))}{$key . '.pdf'} = $Message; The reason I create a token here is that at this point ('/Ticket/Display.html') there seems to be no 'Attachment' in $session The problem persists, post added without attachment -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 AFS_logo.pngfacebook-24x24.pnglinkedin-24x24.png
Re: [rt-users] custom callback for ticket update not working after update 4.0.2 - 4.2.2
On Wed, Feb 5, 2014 at 12:32 PM, Hugo Escobar hesco...@afslc.com wrote: On Wed, Feb 5, 2014 at 10:23 AM, Kevin Falcone falc...@bestpractical.comwrote: On Tue, Feb 04, 2014 at 04:02:05PM -0500, Hugo Escobar wrote: $m-callback( Ticket = $TicketObj, ARGSRef = \%ARGS, checks_failure = \$checks_failure, results = \@results, CallbackName = 'Initial' ); which exists at the beginning of the %INIT section My implementation of this callback creates a MIME::Entity and adds the file to it, then it 'writes' the whole message to $session{'Attachments'} I've been trying to do the right changes for this to work under 4.2.2 but no luck so far You've not shown your code, so I'm guessing, but if you look at how 4.2 stores attachments in the session, it uses a token to finally fix the bug of creating two tickets simultaneously and accidentally attaching the wrong attachments to the wrong ticket. $session{Attachments}{$ARGS{Token}} Relevant code is in ProcessAttachments and you can also see it used in CreateTicket. This is what I do: my $Message = MIME::Entity-build( Type= 'multipart/mixed', Message-Id = RT::Interface::Email::GenMessageId, ); my ( $filehandle, @ar_content, $buffer ); open( $filehandle, , \$content ); while ( my $bytesread = read( $filehandle, $buffer, 4096 ) ) { push @ar_content, $buffer; } close $filehandle; $Message-attach( Filename = $doc_path, Type = 'application/pdf', Data = \@ar_content, ); # Attachment parts really shouldn't get a Message-ID $Message-head-delete('Message-ID'); $Message-make_singlepart; RT::I18N::SetMIMEEntityToUTF8($Message);# convert text parts into utf-8 $session{'Attachments'} = { %{$session{'Attachments'} || {}}, $key . '.pdf' = $Message }; (...) I changed the blue lines by the following: session{'Attachments'}{Digest::MD5::md5_hex(rand(1024))}{$key . '.pdf'} = $Message; The reason I create a token here is that at this point ('/Ticket/Display.html') there seems to be no 'Attachment' in $session The problem persists, post added without attachment Solved. Adding the following lines solves the problem: $ARGSRef-{'Token'} = Digest::MD5::md5_hex(rand(1024)); $session{'Attachments'}{$ARGSRef-{'Token'}}{$key . '.pdf'} = $Message; $ARGSRef-{'UpdateType'} = 'response'; $ARGSRef-{'UpdateAttach'} = '1'; $ARGSRef-{UpdateContent}= 'any text'; Thank you for your help, it pointed me in the right direction -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 AFS_logo.pnglinkedin-24x24.pngfacebook-24x24.png
[rt-users] custom callback for ticket update not working after update 4.0.2 - 4.2.2
I developed a callback that allowed staff users to quickly respond certain requests from customers just by pressing a button on ticket-display instead of having to go to /Ticket/Update.html, writing, attaching the file, etc This worked perfectly on 4.0.2. In 4.2.2, the response is being created but the file(s) is(are) not being attached. The callback I used for this customization is called in the following line: $m-callback( Ticket = $TicketObj, ARGSRef = \%ARGS, checks_failure = \$checks_failure, results = \@results, CallbackName = 'Initial' ); which exists at the beginning of the %INIT section My implementation of this callback creates a MIME::Entity and adds the file to it, then it 'writes' the whole message to $session{'Attachments'} I've been trying to do the right changes for this to work under 4.2.2 but no luck so far Any help will be greatly appreciated -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 facebook-24x24.pnglinkedin-24x24.pngAFS_logo.png
[rt-users] problem extracting custom field values
Hi there: I'm writing a little piece of code to avoid storing duplicate values in custom fields. The custom field in reference is of 'multiple values' type. I do the following: my $CFValues = $Ticket-CustomFieldValuesAsString($cf_name); if ($CFValues=~/$val/ms) { # do not save the cf value } else { # save the cf value } What's really weird is if the custom field currently has one value, the code above seems to be completely ignored. If there's more than one value, it does exactly what i need it to do. This happens when it runs in a callback i wrote which is called by 'Ticket/Update.html' When i run the same snippet in a cli script it works always. I'm totally clueless about what is causing this situation, after spending countless hours i haven't solved this problem. Any help will be greatly appreciated -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 linkedin-24x24.pngAFS_logo.pngfacebook-24x24.png
[rt-users] Cannot sent files of 1MB or larger via REST reqs
Hi, I've been using the REST api for some time to communicate RT with a custom made web app. I'm having problems sending files when their size approach 1MB. The following lines show up in apache's error logs when i attempt to upload big files: [Fri Mar 29 16:07:08 2013] [warn] [client 192.168.1.106] mod_fcgid: error reading data, FastCGI server closed connection [Fri Mar 29 16:07:08 2013] [error] [client 192.168.1.106] Premature end of script headers: rt-server.fcgi For smaller sizes it works perfectly, even with multiple files. I understand this issue might have been caused in the web app (not RT) but i just wanted to know if someone could shed some light here. Are there any size (or otherwise) limits that i could change in RT's (or apache) side? Any help will be highly appreciated -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 linkedin-24x24.pngAFS_logo.pngfacebook-24x24.png
Re: [rt-users] Cannot sent files of 1MB or larger via REST reqs
Thank you Thomas. It seems to be going in the right direction. Just to let you know, the message disappeared since I Added FcgidMaxRequestLen to apache conf. The problem seems to be in the db side, [Fri Mar 29 20:30:23 2013] [warning]: DBD::mysql::rtuser execute failed: MySQL server has gone away at /usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm line 587. (/usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm:587) [Fri Mar 29 20:30:23 2013] [warning]: RT::Handle=HASH(0x6e23eb8) couldn't execute the query 'INSERT INTO Attachments (Subject, ContentType, Filename, Headers, MessageId, Creator, Parent, Created, ContentEncoding, Content, TransactionId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' at /usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm line 600. DBIx::SearchBuilder::Handle::SimpleQuery('RT::Handle=HASH(0x6e23eb8)', 'INSERT INTO Attachments (Subject, ContentType, Filename, Head...', '', 'application/octet-stream', 'some-1mb-file.pdf', 'Content-Type: application/octet-stream; name=some-...', '', 127, 1645, ...) called at /usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm line 350 On Fri, Mar 29, 2013 at 4:24 PM, Thomas Sibley t...@bestpractical.comwrote: On 03/29/2013 01:18 PM, Hugo Escobar wrote: Hi, I've been using the REST api for some time to communicate RT with a custom made web app. I'm having problems sending files when their size approach 1MB. The following lines show up in apache's error logs when i attempt to upload big files: [Fri Mar 29 16:07:08 2013] [warn] [client 192.168.1.106] mod_fcgid: error reading data, FastCGI server closed connection [Fri Mar 29 16:07:08 2013] [error] [client 192.168.1.106] Premature end of script headers: rt-server.fcgi For smaller sizes it works perfectly, even with multiple files. Read the warning about mod_fcgid here: http://bestpractical.com/rt/docs/latest/web_deployment.html#mod_fcgid 1MB isn't the large or small default, but perhaps something else set FcgidMaxRequestLen recently and you need to increase it. -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 AFS_logo.pngfacebook-24x24.pnglinkedin-24x24.png
[rt-users] multiple REST requests, slow results
Hi there, I've been working on a web app that does a lot of REST requests to RT. Recently, I've been assigned the task of adding rich text/html capabilities to the web app ( textareas+ckeditor ). I have completed the task but now the web app takes more time than it used to in order to display a ticket. I found out that RT stores html content as an attachment so now there's an additional web request per each ticket transaction (1 web request per ticket transaction per attachment). If the attachment is 'text/html', I change the content of the ticket transaction. I know the additional web requests is taking a toll on the response time. I would like to know if my approach is the right one or if there are better alternatives I have been thinking that maybe a solution would be to use simultaneous http requests using 'curl_multi_init()' for the attachments. Another idea is to show only a few transactions first and then using ajax I could retrieve more transactions when the user scrolls down to the end of the list ... Any help will be appreciated -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 facebook-24x24.pngAFS_logo.pnglinkedin-24x24.png -- Help improve RT by taking our user survey: https://www.surveymonkey.com/s/N23JW9T
[rt-users] jquery version
Hi there: I'm just curious about if/when is jquery going to be upgraded. I checked the latest rt release (rt-4.0.8) and it still uses jquery 1.4.2 It's been a while since that jquery version was first released ... Thanks -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 linkedin-24x24.pngfacebook-24x24.pngAFS_logo.png
Re: [rt-users] selenium webdriver tests
Update: solved! This certainly this was more a ckeditor question, but anyway, just in case someone had a similar problem: the right way to update the textarea using javascript is *CKEDITOR.instances.UpdateContent.insertText('newer content')* On Mon, Nov 12, 2012 at 4:49 PM, Hugo Escobar hesco...@afslc.com wrote: Hi there: I been implementing a testing environment for custom code based on selenium webdriver. Testing environment: CentOS 6.3, Apache, MySQL, Firefox. So far, I've been successful in running a set of test cases, the only problem I have is when I try to update the textarea (create, or reply ticket). The js script executes showing no errors, etc but the content never changes. My assumption is that the ckeditor is not updating its content when a value has been assigned to the textarea element. I show below a couple of the js snippets of my unsuccessful attempts: =-=-=- document.getElementsByName('UpdateContent')[0].value='Testing ticket reply.' =-=-=-= function UpdateFields() { for (instance in CKEDITOR.instances) { CKEDITOR.instance.setData('asdfasdfasdf'); // CKEDITOR.instances[instance].setData('asdfasdf'); } } Any help will highly appreciated! -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 AFS_logo.pngfacebook-24x24.pnglinkedin-24x24.png We're hiring! http://bestpractical.com/jobs
[rt-users] selenium webdriver tests
Hi there: I been implementing a testing environment for custom code based on selenium webdriver. Testing environment: CentOS 6.3, Apache, MySQL, Firefox. So far, I've been successful in running a set of test cases, the only problem I have is when I try to update the textarea (create, or reply ticket). The js script executes showing no errors, etc but the content never changes. My assumption is that the ckeditor is not updating its content when a value has been assigned to the textarea element. I show below a couple of the js snippets of my unsuccessful attempts: =-=-=- document.getElementsByName('UpdateContent')[0].value='Testing ticket reply.' =-=-=-= function UpdateFields() { for (instance in CKEDITOR.instances) { CKEDITOR.instance.setData('asdfasdfasdf'); // CKEDITOR.instances[instance].setData('asdfasdf'); } } Any help will highly appreciated! -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 AFS_logo.pnglinkedin-24x24.pngfacebook-24x24.png We're hiring! http://bestpractical.com/jobs
Re: [rt-users] Creating a ticket with attachment in PHP
Hi, I found a solution ... for those using PHP to add attachments to existing tickets the pear package 'HTTP_Request2' builds the multipart/mime-data correctly. Here I show a few lines of code that worked perfectly: ?php require_once 'HTTP/Request2.php'; $username = 'user'; $password = 'somepassword'; $url = http://ticket/rt4/REST/1.0/ticket/514/comment?user=$usernamepass=$password ; $attachment_file= getcwd().'/somejpeg.jpg'; $request = new HTTP_Request2($url); $request-setMethod(HTTP_Request2::METHOD_POST) -addPostParameter(content,Ticket: 514\nAction: comment\nText: using HTTP_Request2\nAttachment: somejpeg.jpg\n) -addUpload('attachment_1',$attachment_file,$attachment_file,'image/jpeg'); $request-send(); ? On Tue, May 22, 2012 at 5:33 PM, Hugo Escobar hesco...@afslc.com wrote: Hi there, I have this same problem, i need to add attachments to existing tickets via REST from php. I wrote this small piece of code: =-=-=-=-=-= code =-=-=-=-=-=-=-= $url = http://ticket/rt4/REST/1.0/ticket/514/comment?user=$usernamepass=$password ; $attachment_file= getcwd().'/somejpeg.jpg'; $attachment_content = file_get_contents($attachment_file); $file_name = 'attachment_1; filename=somejpeg.jpg' . \n . 'Content-Type: image/jpeg'; $post_data=array($file_name=$attachment_content, content=Ticket: 514\nAction: comment\nText: aaahhh\nAttachment: somejpeg.jpg\n); $curl_handle=curl_init(); curl_setopt ($curl_handle, CURLOPT_URL,$url); curl_setopt ($curl_handle, CURLOPT_ENCODING, deflate); curl_setopt ($curl_handle, CURLOPT_COOKIEJAR, getcwd().'/cookies.txt'); curl_setopt ($curl_handle, CURLOPT_POST, 2); curl_setopt ($curl_handle, CURLOPT_POSTFIELDS, $post_data); curl_setopt ($curl_handle, CURLOPT_HEADER, 1); curl_setopt ($curl_handle, CURLOPT_RETURNTRANSFER, true); curl_setopt ($curl_handle, CURLOPT_HTTPHEADER, array( 'Expect:' ) ); $response = curl_exec($curl_handle); echo $response; curl_close($curl_handle); =-=-=-=-=-= end code -=-=-=-=-=-=- In order to have a reference, I submitted the file via rt from the command line with complete success. I wanted to look at what 'rt' sends so i used tcpflow to reconstruct the content, see below =-=-=-=-=-= request sent by 'rt' from cli =-=-=-=-=-== POST /rt4/REST/1.0/ticket/514/comment HTTP/1.1 TE: deflate,gzip;q=0.3 Connection: TE, close Host: ticket User-Agent: RT/3.0b Content-Length: 41964 Content-Type: multipart/form-data; boundary=xYzZY Cookie: RT_SID_ticket.80=c593fea8c27488b8b8764196a4b257d3 --xYzZY Content-Disposition: form-data; name=attachment_1; filename=somejpeg.jpg Content-Type: image/jpeg (binary content) --xYzZY Content-Disposition: form-data; name=content Ticket: 514 Action: comment Cc: Bcc: Attachment: somejpeg.jpg TimeWorked: Text: going crazy --xYzZY-- =-=-=-=-=-=-=-= end of content sent by 'rt' =-=-=-==-=-= =-=-=-=-=-=-=-= content sent via php/curl -=-=-=-=-=-=- POST /rt4/REST/1.0/ticket/514/comment?user=someuserpass=somepassword HTTP/1.1 Host: ticket Accept: */* Accept-Encoding: deflate Content-Length: 42046 Content-Type: multipart/form-data; boundary=5e8f1e2cb2d5 --5e8f1e2cb2d5 Content-Disposition: form-data; name=attachment_1; filename=somejpeg.jpg Content-Type: image/jpeg (binary content) --5e8f1e2cb2d5 Content-Disposition: form-data; name=content Ticket: 514 Action: comment Text: aaahhh Attachment: somejpeg.jpg --5e8f1e2cb2d5-- =-=-=-=-=-=-= end of content sent via php/curl =-=-=-=-=-= I think that php is unable to construct messages of type multipart/form-data correctly. By comparing the line just after the boundary (for the binary part) you'll note that they are not equal. I couldn't find a way to replicate what rt generates with php. I tried using a very 'unnatural' key for the file name in $post_data but it doesn't work. All i get is the infamous: RT/4.0.2 400 Bad Request # No attachment for somejpeg.jpg. Any comments? Thanks, Hugo On Mon, Apr 23, 2012 at 10:51 AM, Guillaume Hilt gh...@shadowprojects.org wrote: I hope so because I didn't find anything. I'm still digging and now I'm sending this kind of request to RT : HttpRequest Object ( [options:HttpRequest:private] = [postFields:HttpRequest:**private] = Array ( [content] = id: 56 Action: comment Text: Fichier joint Attachment: ftp_networth.jpg --uploadfichiersupport-- [attachment_1] = filename: ftp_networth.jpg Content-Type: image/jpeg ÿØÿà (file content) Request Content-Type is set to multipart/form-data; boundary=uploadfichiersupport**. I'm trying to find my way using the VB.net example. Guillaume Hilt Le 23/04/2012 16:29, Kevin Falcone a écrit : On Mon, Apr 23, 2012 at 12:09:20PM +0200, Guillaume Hilt wrote: Ok, so i'm trying to comment an existing ticket
Re: [rt-users] Creating a ticket with attachment in PHP
work. First way gives me a syntax error : HttpMessage Object ( [type:protected] = 2 [body:protected] = RT/3.8.10 409 Syntax Error # Syntax error. id: 48 Action: comment Text: Fichier joint Attachment: ftp_networth.jpg attachment_1: \xFF\xD8\xFF\xE0 JFIF ` ` \xFF\xE1 \xE8Exif MM * ; #K -\xB4\xF3\xE5\xC5d\xC90\xAA\**x9D\xCA\xDF+60pGKY^!\xD1cÖ¡\**xB5\xFF J\xB9\xB2\xBB\xB4\x9B\xED \xB7v\xDB Second way gives me this error : PHP Fatal error: Uncaught exception 'HttpInvalidParamException' with message 'Empty or too short HTTP message What am i doing wrong ? I searched in this list archive and google but I didn't find any example on how to send an attachment with PHP and the API. There are tests for this, so I know it works, I suggest using the bin/rt command line client in debug mode to see what it sends over the wire. Otherwise, numerous people have used PHP/Python/Ruby/Java to talk to the REST api so perhaps someone will volunteer some sample code. -kevin -- Hugo Escobar [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 facebook-24x24.pnglinkedin-24x24.pngAFS_logo.png
[rt-users] REST request problem
We've been successfull integrating a web application (based on cakephp) to RT via REST. Here is a list of what we have accomplished with our integration: -. user creation on RT on demand (users exist in our web app, they are created in RT when needed.) -. creating tickets in different queues with custom fields. .- presenting a summary of ticket information as result of querying RT using custom field values as search criteria. -. adding/viewing ticket correspondence, ticket history and other details (requestor, creation date, last update timestamp, etc). There's one thing though that is still preventing us from going live. Sometimes the requests take too much time to respond. It's kind of random, so no pattern that could lead us to locate the problem. We tried disabling devel mode (RT_SiteConfig.pm). The rt log shows nothing in particular except for this entry: [Tue Nov 22 17:11:58 2011] [error] [client 10.0.10.158] FastCGI: server /opt/rt4/sbin/rt-server.fcgi stderr: [Tue Nov 22 22:11:58 2011] [warning]: Use of uninitialized value in string eq at /opt/rt4/sbin/../lib/RT/Tickets.pm line 1614. (/opt/rt4/sbin/../lib/RT/Tickets.pm:1614) It's worth mentioning that at that line, there's this clause: if ( $cf-Type eq 'DateTime' $op eq '=' ) { We used Data::Dumper to see what came out of $cf and there seems to be no 'Type' attribute. We are running RT v4.0.2 on CentOS 5. Any help will be highly appreciated. -- Hugo Escobar hav [image: AFS_logo.png] Follow us on Facebook and Linked-In [image: facebook-24x24.png]http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864 [image: linkedin-24x24.png] http://www.linkedin.com/companies/1006276 AFS_logo.pnglinkedin-24x24.pngfacebook-24x24.png RT Training Sessions (http://bestpractical.com/services/training.html) * Barcelona, Spain November 28 29, 2011