Hi Michael
As a starter, try looking at this JIRA Release User Macro and adapt it. It basically wraps the Jira Issues macro, but could be a start without doing any real programming.
Failing that, find the source for the Jira Issues macro in the Confluence source code and adapt that.