Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-3324

Support replacement of page template variables in wiki links and macro parameters

    • 6
    • 6
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      When using page templates, variables are not recognized when they are inside of wiki constructs (e.g. [@@],

      {@@}

      ).
      Here is an example of a template page, with variables that work and variables that don't:

      Variables where they do not work:

      inside link page title#@pageLink@
      inside include macro {include:@contentPageName@}

      Variables where they do work:

      inside plain text Some random text @variable@

            [CONFSERVER-3324] Support replacement of page template variables in wiki links and macro parameters

            Why has this ticket been languishing? The recommendation provided would actually make variables usable inside templates! I have innumerable use cases for dynamically populating macro parameters. One in particular, is the Jira macro that brings in a list of Jira issues based on a specified JQL statement. These cap out at 1000 issues, and they bog down the load times of pages to an almost unusable level. Being able to dynamically change the filter queries from a variable would be a tremendous difference. 

            Franklin Haynie added a comment - Why has this ticket been languishing? The recommendation provided would actually make variables usable inside templates! I have innumerable use cases for dynamically populating macro parameters. One in particular, is the Jira macro that brings in a list of Jira issues based on a specified JQL statement. These cap out at 1000 issues, and they bog down the load times of pages to an almost unusable level. Being able to dynamically change the filter queries from a variable would be a tremendous difference. 

            The comment above describes exactly what we need for our Release Note process. We build and release many different releases every week and manually updating the embedded Jira link macros with the appropriate client and fix version is massively time consuming and error prone.  The ability to use a page variable (or similar) to build the Jira query links would be so useful.

            Grant Botha added a comment - The comment above describes exactly what we need for our Release Note process. We build and release many different releases every week and manually updating the embedded Jira link macros with the appropriate client and fix version is massively time consuming and error prone.  The ability to use a page variable (or similar) to build the Jira query links would be so useful.

            Asaf Ronen added a comment -

            I have the need to have on a page template a bunch of macros driven by JQL, and all the JQL need to reference a value that I would like to pull from a page variable, so the user does not need to edit the JQL of every macro on the page.  For example a Release Notes page template that contains a bunch of macros querying Jira for counts of issues, all of which need in the JQL "version=@version" where @version is a page variable that the user only would need to specify once for all the macros on the page to function automatically without having to update each macro individually.

            Asaf Ronen added a comment - I have the need to have on a page template a bunch of macros driven by JQL, and all the JQL need to reference a value that I would like to pull from a page variable, so the user does not need to edit the JQL of every macro on the page.  For example a Release Notes page template that contains a bunch of macros querying Jira for counts of issues, all of which need in the JQL "version=@version" where @version is a page variable that the user only would need to specify once for all the macros on the page to function automatically without having to update each macro individually.

            make it work for the cloud @info927

            Snorre Lothar von Gohren Edwin added a comment - make it work for the cloud @ info927

            With our Page Tree Creator you can use tags (variables) in the page title, on the page and also in macro parameters.
            Give it a try: Page Tree Creator Marketplace link
            or try our Live Examples

            EPS Software Engineering AG added a comment - With our Page Tree Creator you can use tags (variables) in the page title, on the page and also in macro parameters. Give it a try: Page Tree Creator Marketplace link or try our Live Examples

            I'm wanting the ability to use this in external links, also. For instance, if an external system's record ID is entered as a variable we would want to populate several links to that external system with this value. (e.g. example.com/logo/$ExtId, example.com/contacts/$ExtId, google.com/search?q=$ExtId, etc.)

            Dakota Duff added a comment - I'm wanting the ability to use this in external links, also. For instance, if an external system's record ID is entered as a variable we would want to populate several links to that external system with this value. (e.g. example.com/logo/$ExtId, example.com/contacts/$ExtId, google.com/search?q=$ExtId, etc.)

            The fact that this is considered a suggestion rather than a basic feature baffles me as well. I went through the process of creating a template that used some JIRA chart macros, and originally I thought I must have the syntax wrong when I referenced a template variable to represent my JIRA project. It really surprised and disappointed me that I wasted a lot of time setting up the template only to realize that I will have to individually modify the same value in 6 different places within my page (in the macro code) to represent the JIRA project EVERY time. Yuck. With literally hundreds of projects, I thought it would be a nobrainer to set up a template that every team could easily use. Very disappointed.

            Carrie Aversa added a comment - The fact that this is considered a suggestion rather than a basic feature baffles me as well. I went through the process of creating a template that used some JIRA chart macros, and originally I thought I must have the syntax wrong when I referenced a template variable to represent my JIRA project. It really surprised and disappointed me that I wasted a lot of time setting up the template only to realize that I will have to individually modify the same value in 6 different places within my page (in the macro code) to represent the JIRA project EVERY time. Yuck. With literally hundreds of projects, I thought it would be a nobrainer to set up a template that every team could easily use. Very disappointed.

            I have attempted a workaround in a user macro. I have posted it here: https://answers.atlassian.com/questions/141785/answers/30948374
            It is not ideal in the sense that JIRA macros rendered in a user macro $body does not work alongside with sectioned layouts.
            But it may have it's purposes anyhow.

            Kim Poulsen added a comment - I have attempted a workaround in a user macro. I have posted it here: https://answers.atlassian.com/questions/141785/answers/30948374 It is not ideal in the sense that JIRA macros rendered in a user macro $body does not work alongside with sectioned layouts. But it may have it's purposes anyhow.

            This seems like a very basic feature.

            Jake Gibson added a comment - This seems like a very basic feature.

            Jens,

            I'm not sure it is an improvement, it is more a feature lost.

            I have created several page templates for which the page creator was invited to set the JIRA project KEY in a variable and it was automatically injecting this value in JIRA filter gadgets and creating a link to project repository.
            And the user was able to rework on the called gadget at the page template level and at the page level too.

            Today the mitigation to obtain the same behaviour is to develop a Blueprint, and not entirely because the user won't be able to modify the filter at the blueprint level. For the end users it is hard to swallow.

            Best Regards, hope we will soon have back the capability to inject $variable inside macros.

            Cyrille Martin added a comment - Jens, I'm not sure it is an improvement, it is more a feature lost. I have created several page templates for which the page creator was invited to set the JIRA project KEY in a variable and it was automatically injecting this value in JIRA filter gadgets and creating a link to project repository. And the user was able to rework on the called gadget at the page template level and at the page level too. Today the mitigation to obtain the same behaviour is to develop a Blueprint, and not entirely because the user won't be able to modify the filter at the blueprint level. For the end users it is hard to swallow. Best Regards, hope we will soon have back the capability to inject $variable inside macros.

              Unassigned Unassigned
              jens@atlassian.com jens
              Votes:
              255 Vote for this issue
              Watchers:
              150 Start watching this issue

                Created:
                Updated: