Problem

      Inserting a User Macro with variables in a Confluence page results in the variables to be displayed as is without substituting their computed values.

      Environment

      Confluence v9.0.x

      Steps to Reproduce

      1. Login as admin
      2. Define a new User Macro with the following template code:
        ## @noparams
        #set($userDetailsManager = $containerContext.getComponent('userDetailsManager'))
        
        #set( $user = $action.remoteUser)
        <h1>
        Hello $req.userPrincipal.name</h1>
        <br />
        Hello $action.remoteUser.name
        <br />
        Hello $user.name
        
        <pre>
        $action.authenticatedUser.name
        $action.authenticatedUser.fullName
        $action.authenticatedUser.key
        $action.dateFormatter.formatGivenString("yyyy-MM-dd", $content.getCreationDate())
        
        </pre>
        
      3. Set Macro Body Processing to Rendered
      4. Create a new page and add the macro created above.
      5. Save the page

      Expected Results

      Variables in the macro are resolved and the page shows/renders variable values.

      Actual Results

      Macro displays literal variable names instead of resolved / rendered values.
      Factoring in the following system property does not help

      -Dmacro.required.velocity.context.keys=comma,seperated,key,values
      

      Workaround

      Currently there is no known workaround for this behavior.

            [CONFSERVER-97796] Variables in user macro are not resolved

            Brent Lin made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 981784 ]
            Jordan Anslow made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]
            Kusal Kithul-Godage made changes -
            Remote Link New: This issue links to "R9.0 P1. Baseline › Database Integration Tests › issue-90-CONFSERVER-97796-bump-vel-allowlist (server-syd-bamboo)" [ 943454 ]
            Kusal Kithul-Godage made changes -
            Remote Link New: This issue links to "R9.0 P1. Baseline › WebDriver tests (Chrome) › issue-90-CONFSERVER-97796-bump-vel-allowlist (server-syd-bamboo)" [ 943366 ]
            Kusal Kithul-Godage made changes -
            Remote Link New: This issue links to "R9.0 P1. Baseline › Main Plugins - Frontend › issue-90-CONFSERVER-97796-bump-vel-allowlist (server-syd-bamboo)" [ 943453 ]
            Kusal Kithul-Godage made changes -
            Remote Link New: This issue links to "R9.0 P1. Baseline › Code Check - Static Analysis › issue-90-CONFSERVER-97796-bump-vel-allowlist (server-syd-bamboo)" [ 943505 ]
            Kusal Kithul-Godage made changes -
            Remote Link New: This issue links to "R9.0 P1. Performance › Page Weight Ratchet Build › issue-90-CONFSERVER-97796-bump-vel-allowlist (server-syd-bamboo)" [ 943365 ]
            Kusal Kithul-Godage made changes -
            Remote Link New: This issue links to "R9.0 P1. Baseline › Main Plugins - Open › issue-90-CONFSERVER-97796-bump-vel-allowlist (server-syd-bamboo)" [ 943364 ]
            Kusal Kithul-Godage made changes -
            Remote Link New: This issue links to "R9.0 P1. Baseline › Main Tests (Postgres 16) › issue-90-CONFSERVER-97796-bump-vel-allowlist (server-syd-bamboo)" [ 943504 ]
            Kusal Kithul-Godage made changes -
            Remote Link New: This issue links to "R9.0 P1. Baseline › Cluster Tests, Postgres 16, Java 21 › issue-90-CONFSERVER-97796-bump-vel-allowlist (server-syd-bamboo)" [ 943363 ]

              854eef6f5746 Kusal Kithul-Godage
              5c3a8aca27ce Mohit Sharma
              Affected customers:
              0 This affects my team
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: