Friday, January 30, 2015

Confluence User Macro - Using a rest interface with jquery and javascript

While implementing Confluence, I took note of the Jira ticket integration. Upon looking at WebHelpDesk, I found an available rest interface. However, WebHelpDesk does not include the CORS compliant responses in it's response packets, so browsers won't allow cross site-scripting. Using a netscaler or other similar solution, one could make the requests through such a means and have the response packets add the CORS compliant header.

With that hurdle out of the way, it was simply a matter of parsing the REST response using jquery, and building the HTML. Using the existing CSS references, and a custom icon, I built a macro that takes a ticket number in confluence, and builds it like a Jira ticket link.


## Macro title: WHD Ticket Macro
## Macro has a body: Y or N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: Jared Shippy
## Date created: 01/30/2015
## Installed by: My Name


## @param Ticket:title=TicketNumber|type=string|required=true|desc=WebHelpDesk Ticket Number









No comments:

Post a Comment