Problems using JIRA issues plugin in confluence 4 templates

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?

2 answers

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}

Thanks for the suggestion, but unfortunately I get the same problem if I change it to jiraissues.

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.

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:


{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

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!

That was it! AWESOME.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

368 views 20 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you