本文转自:https://confluence.atlassian.com/doc/jira-issues-macro-139380.html
Add the Jira Issues macro to a page to display information from Jira. You can display a single issue, a list of issues, or a count, based on a JIRA Query Language (JQL) search, filter, or URL.
This is great for:
The macro can display issues from any connected Jira Server, Data Center, or Cloud application, including Jira Software and Jira Service Management.
Screenshot: Project status page with a Jira issues macro showing issues that must be resolved before release.
Before you can use this macro, your Confluence and Jira application must be connected via Application Links. People viewing the page will see the publicly accessible issues from the Jira site. If your Jira site has restricted viewing (that is, people need permission to view issues) then they will need to authenticate before seeing the restricted issues.
See Use Jira applications and Confluence together for more information.
To add the Jira macro to a page:
You can then publish your page to see the macro in action.
Screenshot: Configuring the Jira Issues Macro to show a list of issues.
You can use the macro to display a table of issues on your page, based on the results of a search using JIRA Query Language (JQL).
JQL is a simple query language that is similar to SQL. A basic JQL query consists of a field, followed by an operator (such as = or >), followed by one or more values or functions.
Examples:
The following query will find all issues in the 'TEST' project:
project = "TEST"
The following query will find all issues in the 'documentation' component of the 'CONF' project:
project = CONF and component = documentation
For more information about JQL syntax, see Advanced searchingin the Jira Software documentation.
To display a table of issues based on a JQL search:
Screenshot: Display options in the Jira Issues macro browser.
You can paste any of the following Jira application URLs into the Jira Issues macro. Confluence will immediately convert the URL to a JQL search.
Auto-convert: You can paste URLs directly into the Confluence editor (without calling up the macro browser). Confluence will automatically convert the URL into a Jira Issues macro.
To display a single Jira issue, choose one of the following methods:
You can choose to show just the issue key, or the issue key and a summary. Select the macro placeholder and choose Show Summary or Hide Summary.
To display a subset of Jira issues from your search results:
Screenshot: Selecting a subset of issues to display
You can choose to display the number of issues returned by your search, rather than a table of issues. The Jira Issues macro will display a count of issues, linked to the search in your Jira application.
Screenshot: The Jira Issues macro displaying an issue count.
To display an issue count:
While editing a Confluence page, you can create an issue in Jira and display it on your Confluence page, without leaving the Confluence editor.
To create an issue and add it to your page:
Confluence will send a request to your Jira application, to create the issue, then display the newly created issue on your page.
Limitations
The Jira Issues macro will notify you if it is unable to create an issue in the selected project. This may be because the project has a required field, field configuration or other customization that is not supported by the Jira Issues macro. In this situation you will need to create the issue directly in your Jira application.
Before you can use this macro, your Confluence and Jira sites must be connected via Application Links.
If the Jira site allows anonymous users to view issues, you must configure an application link, but there's no need to configure any incoming or outgoing authentication between the Jira application and Confluence. People viewing the Confluence page will see the publicly accessible issues.
If your Jira site has restricted viewing, or if some projects or issues are restricted to viewing by certain people, then people will be prompted to Log in & Approve before seeing the restricted issues.
Formatted fields from Jira can be displayed in Confluence if you set up a Confluence-to-Jira application link. Otherwise, such formatted fields will be escaped within the output of the Jira issues macro. This is to prevent the possibility of malicious HTML being served by an untrusted Jira server. The most likely field where you will notice this is in the description field.
This example shows how a description column may be displayed in Jira:
This is
If there is no application link between Jira and Confluence, the description will appear in the Jira issues macro like this:
<p>This is<ul><li>the description</li><li>of my issue</li></ul></p>
The functionality is provided by a system app called 'Jira Macros'. To make the macro unavailable on your site, you can disable the app. See Disabling and enabling apps.
HTTPS: The Jira Issues macro can access a Jira application running under SSL provided the Confluence server is configured to accept the Jira SSL certificate. See Connecting to LDAP or Jira applications or Other Services via SSL.
Custom
fields can be added as columns to the table simply by using the name of
the field with no quotes. Earlier versions of the macro required you to
use the custom field id, e.g. customfield_10100.
This is useful when you want to add a macro outside the editor, for example as custom content in the sidebar, header or footer of a space.
Macro name: jiraissues
Macro body: None.
This example uses a Jira filter.
{jiraissues:anonymous=true|url=https://jira.atlassian.com/issues/?filter=41225}
A number of additional parameters that are not available via the macro browser are available in storage format and wiki markup.
See additional parameters...