Uploaded image for project: 'Atlassian Ecosystem'
  1. Atlassian Ecosystem
  2. ECO-6

JavaScript API doesn't work if Jira runs in iframe itself

    • Minor
    • 3

      Created from https://ecosystem.atlassian.net/browse/ACJIRA-2613

      Issue Summary

      Our customers want to embed our Jira app’s UI into Confluence pages. To do so, they add an iframe using Confluence’s built-in iframe macro, pointing to the respective Jira URL (e.g. https://foo.atlassian.net/projects/FOO?selectedItem=com.atlassian.plugins.atlassian-connect-plugin:app.jxl).

      In this setup, the Connect JavaScript API - while being loaded seemingly successfully - doesn’t work; the various callbacks, like window.AP.getCurrentUser, simply never resolve.

       

      To verify, call

      window.AP.getCurrentUser((x) => console.log(x));

       

      from the Connect iframe's console. It works if Jira runs in its own browser window, but doesn’t resolve if Jira runs within the iframe.

      There's suspicion that Connect gets confused about to the two nested iframes: First, Jira in Confluence, and then our app in Jira.

      Steps to Reproduce

      1. Confluence’s built-in iframe macro, pointing to the respective Jira URL (e.g. https://foo.atlassian.net/projects/FOO?selectedItem=com.atlassian.plugins.atlassian-connect-plugin:app.jxl).
      2. Call from the Connect iframe's console:
        window.AP.getCurrentUser((x) => console.log(x));

      Expected Results

      It resolves within Jira iframe.

      Actual Results

      It doesn’t resolve if Jira runs within the iframe. 

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

       

      Additionally it blocks important use cases for customers.

            [ECO-6] JavaScript API doesn't work if Jira runs in iframe itself

            Sam Leatherdale made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Gathering Impact [ 12072 ] New: Closed [ 6 ]
            Ekin Bukulmez made changes -
            Remote Link Original: This issue links to "ECOHELP-26923 (Ecosystem Jira)" [ 826806 ] New: This issue links to "ECOHELP-26923 (Ecosystem JIRA)" [ 826806 ]
            Ekin Bukulmez made changes -
            Link New: This issue is duplicated by ECO-69 [ ECO-69 ]
            Damian Kleszcz made changes -
            Remote Link New: This issue links to "ECOHELP-26923 (Ecosystem Jira)" [ 826806 ]
            Damian Kleszcz made changes -
            Labels Original: Javascript connect-add-on iframe New: Javascript connect-add-on ecohelp iframe
            Sean Bourke made changes -
            Component/s Original: Forge - External API Authentication [ 72134 ]
            Component/s New: Connect - Frameworks [ 72154 ]
            pqz made changes -
            Component/s Original: Forge - External API Authentication [ 70855 ]
            Component/s New: Forge - External API Authentication [ 72134 ]
            Key Original: JRACLOUD-79756 New: ECO-6
            Project Original: Jira Cloud [ 18514 ] New: Atlassian Ecosystem [ 22710 ]
            SET Analytics Bot made changes -
            UIS Original: 1 New: 3
            SET Analytics Bot made changes -
            UIS Original: 3 New: 1
            SET Analytics Bot made changes -
            UIS Original: 1 New: 3

              a927362f27e1 Varun Bhargava (Inactive)
              ed2f9d56d345 Szymon Rękawek
              Affected customers:
              24 This affects my team
              Watchers:
              21 Start watching this issue

                Created:
                Updated:
                Resolved: