I'll start by saying what I am trying to achieve. I want to be able to set up Jira to comment on a Jira issue whenever a Bitbucket pull request is merged that contains that particular issue. I want to set up the comment to contain a message like "This issue was merged from <branch merging from> to <target branch>".
On our Jira server we already have a "Pull Request Merged" trigger and I can create a Post Function on that transition. Which leads me to the JMWE where I can construct the message using groovy templates. I can't see how I can get the Bitbucket variables I need though to complete the message, I can only see Jira variables available to put in the message.
Any help is greatly appreciated.