[rt-users] need to run code when user presses a button
Landon Stewart
lstewart at iweb.com
Thu Mar 26 17:49:19 EDT 2015
On Mar 26, 2015, at 11:52 AM, Al Joslin <allen.joslin at gmail.com> wrote:
>
> I would like to have a button on the display page of a ticket that when clicked runs some code (*) which then causes the display page to refresh
>
> I have the code (*) written which queries a remote database and updates an rt ticket based on what it finds
> - this is all perl code, using DBI to connect the external db
>
> I don’t care if the code is stored in RT or not
>
> How can I do this?
>
> I can create a button on the Ticket display page which submits a form to an url, perhaps I should return the result as a redirect back to the Ticket display page ?
Hi Al,
There is probably a way to hack this into the RT pages but the way I'd probably do it is build a separate webpage on a different virtualhost that will do what you want (very simple page with the button) and the necessary headers to redirect to the referrer. Then I'd use a custom field to show that page (custom fields can show data *or* actual webpage content). When I click the button within the custom field that's displaying this other page it would go to that page, do what it's supposed to do and then redirect back to the referrer (the display page in RT). Be sure to protect the page on the virtualhost somehow so it's not available to someone who should not see/use it.
Landon Stewart : lstewart at iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20150326/98431e75/attachment.sig>
More information about the rt-users
mailing list