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

Advanced Roadmaps macro fails to display Jira Roadmap due to 401 Unauthorized error

    XMLWordPrintable

Details

    Description

      Atlassian Update - 24 Jan 2024

      For customers on LTS 7.19 Please note that the Advanced roadmaps plugin is not bundled and is located on the marketplace. A fix for this issue is released in version 1.2.3.3 and can be updated in UPM or from:
      https://marketplace.atlassian.com/apps/1221237/advanced-roadmaps-for-jira-in-confluence?tab=overview
      For customers on 7.20+ The plugin is bundled in Confluence and cannot be updated via UPM or the Marketplace. Please upgrade to either 8.5.6+ or 8.8+ to get the fix

      Issue Summary

      Advanced Roadmap macro fails to display Jira Roadmap when using Jira 9.11.0 or later release.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Install Jira 9.11.0 or later versions
      2. Install Confluence + Advanced Roadmaps for the Jira in Confluence app version 1.2.3
      3. Create a reciprocal application link between Jira and Confluence (using either OAuth or OAuth impersonation)
      4. Create a plan using Advanced Roadmaps for Jira on the Jira side
      5. After creating the plan, click "Share"
      6. Select Confluence from the opened panel, click the "Generate link" and copy the URL.
      7. Create a blank page on Confluence
      8. Add Advanced Roadmaps Plan macro and use the generated URL from the previous step
      9. Preview the plan or publish the page. 

      Expected Results

      The Jira plan is displayed without issues in the Advanced Roadmap macro

      Actual Results

      The Advanced Roadmap macro displays a red banner with the message "Something went wrong". See screenshot below:

      If banner is expanded and you click in View Log, the following stack trace is observed:

      Stack Trace
      Failed to fetch
      
      TypeError: Failed to fetch
          at b.supported.window.fetch (https://JIRA_URL/jira/s/17c6f71e34380deac794d8ffd6ebbf0a-CDN/7mmhfs/9110002/1dlckms/c3c2e403184ce3da5a4df5661c6fc5a3/_/download/contextbatch/js/com.atlassian.jpo.page-common,atl.general,jira.global,-_super/batch.js?agile_global_admin_condition=true&baseurl-check-resources=true&healthcheck-resources=true&jag=true&jaguser=true&locale=en-US:19:10)
          at l (https://JIRA_URL/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/7mmhfs/9110002/1dlckms/9.11.2/_/download/batch/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog.js:5:1100)
          at r (https://JIRA_URL/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/7mmhfs/9110002/1dlckms/9.11.2/_/download/batch/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog.js:5:1690)
          at 5 (https://JIRA_URL/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/7mmhfs/9110002/1dlckms/9.11.2/_/download/batch/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog.js:5:1717)
          at n (https://JIRA_URL/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/7mmhfs/9110002/1dlckms/9.11.2/_/download/batch/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog.js:5:101)
          at https://JIRA_URL/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/7mmhfs/9110002/1dlckms/9.11.2/_/download/batch/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog.js:5:451
          at https://JIRA_URL/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/7mmhfs/9110002/1dlckms/9.11.2/_/download/batch/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog/com.atlassian.jpo:jpo-wr-page-simple-plan-preload-backlog.js:5:460
      

      Besides this, if Jira HTTP Dump Logging is enabled the following can be seen in the request OPTIONS https://JIRA_URL/jira/rest/jpo/1.0/backlog you can see the following:

      172.50.0.2 o483x383x1 - [18/Oct/2023:08:03:29 +0000] "OPTIONS https://JIRA_URL/jira/rest/jpo/1.0/backlog HTTP/1.1" 401 174 0.0030 "https://JIRA_URL/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36" -
      
      ...
      ...
              Response HTTP Headers :
                      X-AUSERNAME=anonymous
                      Cache-Control=no-transform
                      Content-Type=application/xml
                      Vary=Accept
              Response Data (total 174 bytes) :
      
          <?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>401</status-code><message>Client must be authenticated to access this resource.</message></status>
      

       
      This 401 Unauthorized can also be observed in a HAR file:

      Workaround

      Workaround 1)

      1. Enable HTML Macros as explained in HTML Macro
      2. Browse to your Jira plan and click "Share"
      3. Select Embed from the opened panel, and click "Copy"
      4. Edit your Confluence page and add a HTML macro.
      5. Inside this new macro, paste the content copied previous from the Jira plan and Save your page.

      Workaround 2)
      Jira 9.11 uses atlassian-html-encoder version 1.5 --> So the changes need to be done on Jira side.

      As a work-around, you can downgrade the atlassian-html-encoder jar to version 1.4 in your Jira <JIRA_INSTALL>/atlassian-jira/WEB_INF/lib directories to get the old Jira behaviour.

      Attachments

        Issue Links

          Activity

            People

              ephillips@atlassian.com Edward
              d8a006ac9dc7 Iker Alonso
              Votes:
              110 Vote for this issue
              Watchers:
              141 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: