From 5f3238b48ae4e8ea24a3bac6e71104c3e067303c Mon Sep 17 00:00:00 2001 From: Joris Conijn Date: Tue, 13 Dec 2022 11:56:27 +0100 Subject: [PATCH] feat: support ac:jiraissues macro Add support for the `ac:jiraissues` macro. By adding the template to the stdlib. Not sure if there are other places where you need to add stuff for macros. Or how I could test this locally. --- README.md | 14 ++++++++++++++ pkg/mark/stdlib/stdlib.go | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/README.md b/README.md index 82b2092..6c03207 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,20 @@ By default, mark provides several built-in templates and macros: See: https://confluence.atlassian.com/conf59/status-macro-792499207.html +* template `ac:jiraissues` to include a list of JIRA tickets. Parameters: + - URL (Required), The URL of the XML view of your selected issues. (link to the filter) + - Anonymous (Optional) If this parameter is set to 'true', your JIRA application will return only the issues which allow unrestricted viewing. That is, the issues which are visible to anonymous viewers. If this parameter is omitted or set to 'false', then the results depend on how your administrator has configured the communication between the JIRA application and Confluence. By default, Confluence will show only the issues which the user is authorised to view. + - BaseURL (Optional) If you specify a 'baseurl', then the link in the header, pointing to your JIRA application, will use this base URL instead of the value of the 'url' parameter. This is useful when Confluence connects to JIRA with a different URL from the one used by other users. + - Columns (Optional) A list of JIRA column names, separated by semi-colons (;). You can include many columns recognized by your JIRA application, including custom columns. + - Count (Optional) If this parameter is set to 'true', the issue list will show the number of issues in JIRA. The count will be linked to your JIRA site. + - Cache (Optional) The macro maintains a cache of the issues which result from the JIRA query. If the 'cache' parameter is set to 'off', the relevant part of the cache is cleared each time the macro is reloaded. (The value 'false' also works and has the same effect as 'off'.) + - Height (Optional) The height in pixels of the table displaying the issues. + - RenderMode (Optional) If the value is 'dynamic', the JIRA Issues macro offers an interactive display. + - Title (Optional) You can customise the title text at the top of the issues table with this parameter. For instance, setting the title to 'Bugs-to-fix' will replace the default 'JIRA Issues' text. This can help provide more context to the list of issues displayed. + - Width (Optional) The width of the table displaying the issues. Can be entered as a percentage (%) or in pixels (px). + + See: https://confluence.atlassian.com/doc/jira-issues-macro-139380.html + * template: `ac:emoticon` to include emoticons. Parameters: - Name: select emoticon - smile diff --git a/pkg/mark/stdlib/stdlib.go b/pkg/mark/stdlib/stdlib.go index f1bc132..250f231 100644 --- a/pkg/mark/stdlib/stdlib.go +++ b/pkg/mark/stdlib/stdlib.go @@ -139,6 +139,22 @@ func templates(api *confluence.API) (*template.Template, error) { ``, ), + /* https://confluence.atlassian.com/doc/jira-issues-macro-139380.html */ + `ac:jiraissues`: text( + ``, + `{{ or .Anonymous false }}`, + `{{ or .BaseURL .URL }}`, + `{{ or .Columns "type;key;summary;assignee;reporter;priority;status;resolution;created;updated;due" }}`, + `{{ or .Count false }}`, + `{{ or .Cache "on" }}`, + `{{ or .Height 480 }}`, + `{{ or RenderMode "static" }}`, + `{{ or .Title "Jira Issues" }}`, + `{{ .URL }}`, + `{{ or .Width "100%" }}`, + ``, + ), + /* https://confluence.atlassian.com/conf59/info-tip-note-and-warning-macros-792499127.html */ `ac:box`: text(