Is there any way to export tickets?

I was wondering what the easiest way to export tickets for a queue was.
If anyone could point me to some example scripts/code I would appriciate
it.