Create Trac ticket from Google Form GAS script?

2019-07-27 12:53发布

问题:

This is a followup question to my original question here. The decision between Bugzilla & Trac seems to have been made for us, and Trac it is. Here are the options I've found so far:

  • Leverage our current Google Form based bug report by modifying the GAS script that is doing our email notification. So far I've been unable to find an example, but it would appear that you can modify the email portion of the GAS script to send email to the Trac server to open a ticket automatically. This is my preferred option, but I'd like to see an example if possible.

  • Create something using TracCmdScript, but the site hasn't been updated in three years, and it appears to use python, a language I'm not proficient at (although I'd like to be) and the XmlRpcPlugin, which seems to be under current development.

  • There's also an email option website cited on this SO page to use email2trac, but the cited site appears to be dead. Edit: here's the new site: email2trac which still hasn't been touched in a couple of years, but seems to be functional.

I'm open to any other suggestions the SO folks might have.

回答1:

I have found the XMLRPC plugin to be the most reliable way of automating interaction with Trac. Practically every major programming/scripting language has libraries available for doing either XML RPC or JSON RPC calls, which means that most of the difficult stuff will be handled for you. If you already have a script that takes the submitted form data and formats it into an email, then you should be able to modify that script to take the same data and format it into XML or JSON and shuffle it off to Trac. The XMLRPC Plugin's website includes some sample code in multiple languages for sending RPC commands to a Trac server.