How do I create a new ticket in extensions?

How do I create a new ticket in extensions?

I'm a complete beginner trying to create a simple extension that creates a new ticket on load. Just as a test for something else I am working on.

I've read the documentation guide 
This guide does not seem to mention anything about this

I looked to Deluge documentation 
At first it looks like this is what I need but trying it nothing works for me.

I'm quite stumped and could really use a step by step guide on how to accomplish this. Any help is appreciated.