Problems using JIRA issues plugin in confluence 4 templates
Asked by Rebecca Sheridan:

Hi,

In a template, we are using the JIRA issues macro. Since templates can only take wiki markup, we have to use wiki markup for the plugin (we can't use the macro browser).

We were trying to use something like this:

{jira: labels=show_on_wiki\|columns=client,summary,labels,assignee,due date,status,key\|renderMode=static\|title=Program Setup}

I get the error:

Error rendering macro 'jira' : JIRA project does not exist or you do not have permission to view it.

If I drop all the parameters like so:

{jira: labels=show_on_wiki}

It works fine!

Basically, if I add any parameter to it, it completely breaks. It doesn't matter which parameter. Is this just because the JIRA plugin has changed for Conf 4? Is there any workaround, so I can get the wikimarkup right in the template?


Answers:
author: Mark Hrynczak
body: Ok, instead of guessing, I have looked into this some more.

The problem is because of the 2 different macros - you can use {jira} or {jiraissues} interchangeably, but the parameters you give have to be consistent.

That is, you can **either**:

* Use {jira:\<some_jql_statement\>}
* Use {jira:url=xxx,columns=yyy,title=zzz}

In the first of these you can use any jql you like, but there are no other parameters or config options available.

In the second, you have access to all of the standard parameters, but it does not take JQL, you need to use the compulsory 'url' parameter which takes the XML link of the search you want to use.

I hope that makes sense. The workaround to use, then, is:

1. Go to your JIRA instance, and do a search for "labels=show_on_wiki"
2. Open the 'Views' menu and copy the link for the 'XML' item
3. In Confluence, create a template and use the markup:

{jira:url=\<COPIED_LINK\>\|columns=client,summary,labels,assignee,duedate,status,key\|renderMode=static\|title=Program Setup}

This is described in more detail [here](http://confluence.atlassian.com/display/DOC/JIRA+Issues+Macro#JIRAIssuesMacro-DisplayingaListofJIRAIssuesfromanyAccessibleJIRASite).

comments: author: Rebecca Sheridan
body: That's really helpful. So, unfortunately, there's another layer of complication on top of it. If you figure this out, you'll be my hero!

We were using the reporting plugin to inject a variable into the jql statement. For example:

{report-on:injected=true}  
{jira: labels=show_on_wiki and client=%data:client%\|columns=client,summary,labels,assignee,due date,status,key\|renderMode=static\|title=Program Setup}  
{report-on}

This used to work great until we went to Conf. 4, but you figured out we now need to go using the URL. So, if I try to inject the same thing in the URL where the client code would be it doesn't work:

<br />

{report-on:injected=true}  
{jira:url=https://ourwebsite.com/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=labels+%3D+show_on_wiki+AND+Client+%3D+%data:client%\&tempMax=15000columns=client,summary,labels,assignee,due date,status,key\|renderMode=static\|title=Program Setup}  
{report-on}

I would guess this is because the URL field can't accept a variable like the labels field could. ??? Any ideas?

Thanks so much for helping us track this down!

Rebecca


author: CharlesH
body: Regarding your use of the jira macro and injecting a variable value into the jql, I think your error is likely to be due to the occurrences of %3D in the query. This is confusing the injection, which uses % as delimiters. You should find that if you double up the % characters in the cases where they don't represent injection delimiters, it should work successfully. I.e. %%3D. Fingers crossed!


author: Rebecca Sheridan
body: That was it! AWESOME.


author: Mark Hrynczak
body: I *think* that the problem is because there are actually 2 different JIRA Issues macros available.

{jira} is the one which is inserted by the "Insert JIRA Issues" dialog in Confluence 4.

{jiraissues} is the one which was available in wiki markup which allows additional parameters.

So on your template, using the following should work fine:
> {jiraissues:labels=show_on_wiki\|columns=client,summary,labels,assignee,due date,status,key\|renderMode=static\|title=Program Setup}

comments: author: Rebecca Sheridan
body: Thanks for the suggestion, but unfortunately I get the same problem if I change it to jiraissues.


Tags: jira

template