Forums/Community/Zendesk Apps

Saving "internalNote" comments programmatically (without hitting "Submit")?

Jeff Tanner
posted this on September 13, 2012 16:02

Hi

I would prefer to add a comment to a ticket after using our App.

Our app is used for purchasing a rewards card to send to ticket requesters.

I wish to persist purchase confirmation within the ticket.

I am writting the purchase confirmation within the ticket as follows:

var orderConfirmation = <Details>
this.comment().type('internalNote');
this.comment().text(orderConfirmation);

Is there a way I can programmatically persist this.comment() without the user having to hit the "Submit" button within the ticket?

Thanks

 

Comments

User photo
James Rosen
Zendesk

There sure is. You can use the HTTP tickets API via an AJAX call.

September 13, 2012 16:15
User photo
Jeff Tanner
tangocard

Thank you, I will give it a try,

- Jeff

September 14, 2012 09:44
User photo
Jeff Tanner
tangocard

Hi James

Hi James

Thanks for the providing the link to handling ticket comments using HTTP tickets API via an AJAX call.

However, it currently has known issues as mentioned within:

https://support.zendesk.com/entries/22016887

Is there another approach to adding & persisting comments within a ticket?

Thx

- Jeff

September 16, 2012 07:52
User photo
James Rosen
Zendesk

There is not, though using root-relative URLs currently works. Can you describe your use case for using fully-qualified URLs?

September 16, 2012 08:12
User photo
Jeff Tanner
tangocard

Hi James

you should get some sleep sometimes :)

I am assuming this is a fully-qualified URL:

https://jeff00tangocard.zendesk.com/api/v2/tickets/5.json

Please provide an example of a "root-relative URLs"

Thx

- Jeff

 

 

September 16, 2012 09:08
User photo
James Rosen
Zendesk

"Root-relative" means starting with a "/", which means it's relative to the domain. Thus, "/api/v2/tickets/5.json" is a shortcut for "https://jeff00tangocard.zendesk.com" if the current page is on somewhere in "https://jeff00tangocard.zendesk.com", e.g. "https://jeff00tangocard.zendesk.com/agent/".

September 16, 2012 09:10
User photo
Jeff Tanner
tangocard

Thx for the "Root-relative" info

I will give "/api/v2/tickets/5.json" a try.

- Jeff

September 16, 2012 09:27