User macro nesting problem
Asked by L?szl? Pecsenye:

Hi all,

I'm trying to create a new user macro to achieve following:

* It asks a JIRA issue id as a parameter.
* It includes the given JIRA issue into the page as table
  * Column list of JIRA issue is fixed (e.g. key, summary, description)
* It adds some extra formatting (CSS code) to the table.

My user macro includes the jiraissues macro.

If I include only one JIRA issue into a page, then my macro works fine. But if I try to include more instances of my macro (more jira issues) into the same page, then only the very first JIRA issue is included and it is repeated many times.

Here is the source of my user macro:

```
## Macro title: BRS JIRA k?vetelm?ny
## Macro has a body: N
## Body processing: Rendered
## Output: XHTML
##
## Developed by: Pecsenye L?szl?
## Date created: 30/07/2019

## @param reqId:title=JIRA Req ID|type=string|required=true|desc=JIRA Req ID

<style>
.brs-jira-req .jira-issues table tbody tr th {
display: none;
}
.brs-jira-req .jira-issues table tbody tr.rowNormal td.jira-macro-table-underline-pdfexport {
display: inline-block;
}

</style>

<div class="brs-jira-req">

<ac:structured-macro ac:name="jiraissues" ac:schema-version="1" ac:macro-id="$!paramreqId">
<ac:parameter ac:name="url">http://localhost:8080/browse/?jql=key%20%3D%20$!paramreqId</ac:parameter>
<ac:parameter ac:name="columns">key;summary;description</ac:parameter>
<ac:parameter ac:name="renderMode">static</ac:parameter>

</ac:structured-macro>
</div>
```

Any ideas?

Thanks in advance,

LAci


Answers:
author: JP _AC Bielefeld Leader_
body: Hi,

what Jira \& Confluence version are you using?

I ask because I cannot recognize the macro you're referencing.

When I embed a Jira macro in Confluence the storage format looks like:

```
<ac:structured-macro ac:macro-id="55ff4992-013f-4f42-8d4d-00f6e0fdf217" ac:name="jira" ac:schema-version="1">
<ac:parameter ac:name="server">My Jira Server Name</ac:parameter>
<ac:parameter ac:name="serverId">the server id</ac:parameter>
<ac:parameter ac:name="key">JIRA-1234</ac:parameter>
</ac:structured-macro>
```

or as a table

```
<ac:structured-macro ac:macro-id="6cb4b3ad-e0e6-4fac-86a3-dd6269dd4398" ac:name="jira" ac:schema-version="1">
<ac:parameter ac:name="server">My Jira Server Name</ac:parameter>
<ac:parameter ac:name="columns">key,summary,description</ac:parameter>
<ac:parameter ac:name="maximumIssues">5</ac:parameter>
<ac:parameter ac:name="jqlQuery">project = JIRA AND assignee = "abc" AND NOT resolution IS EMPTY ORDER BY updated </ac:parameter>
<ac:parameter ac:name="serverId">the server id</ac:parameter>
</ac:structured-macro>?
```

It seems to me, that a non-standard macro is used. If this is the case please contact the macro app vendor.

Best

JP

comments: author: JP _AC Bielefeld Leader_
body: Hi again,

pretty sure you're using an older version of Jira and/or Confluence.

I'll try your macro with the latest versions.

Best

JP


author: L?szl? Pecsenye
body: Hello JP,

Currently I'm using the evaluation version (local server) of Confluence 6.15.7 + JIRA v8.3.0#803001).

Anyway, I rewrote my embed code according to your 2nd example, and now it is working as expected.

Thank you for your quick help.

BR,

LAci


Tags: confluence-server

server

user-macro