Redirect Atlassian connect app to my website when connect app is installed from jira marketplace

Hi,

How can I be redirected to my website when the Atlassian Connect app is installed from Atlassian Marketplace?

Please help me with this.

This is how it is currently used

Step1
From my website click on Activate Sprint

Step2
This will redirect to the Atlassian marketplace click on “Get it now” select a site and install the app

Step3
this redirects to Jira software where I click on “Get it now”

Step4
The app is installed successfully

What I want is to redirect to my website after Step3

1 Like

@SatishKumar1,

You cannot. At least, not as directly as you can from an OAuth 2.0 flow, for example.

You will probably want to implement a few things to compensate:

  • Create a configurePage that is responsible for “closing the loop” and navigating back to your site.
  • Use the postInstallPage to redirect into that configurePage after installation.
  • Use a web item on system.top.navigation.bar to also point to the configurePage to catch folks that navigate away before “closing the loop”.
1 Like

Hi @ibuchanan,

After adding postInstallPage changes facing some issues. Tried referring to this doc Better know a feature: the fightin' postInstallPage - Atlassian Developer Blog but the link to the source code and other stuff is not working. Can you help me with what I’m missing?

Added this to atlassian-connect.json file

    "modules": {
        "postInstallPage": {
            "url": "/my-post-install-page",
            "name": {
                "value": "My Post-Install Page",
                "i18n": "mypostinstallpage.name"
            },
            "key": "my-post-install-page"
        }
    }

added this to index.js file

  app.get('/my-post-install-page', addon.authenticate(), (req, res) => {
    console.log("inside my-post-install-page");
    res.render(
      'postinstallpage',
      {
        title: 'Atlassian Connect'
      }
    )
  });

created postinstallpage.hbs file

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="refresh" content="0;url=/configure-page">
    <title>Redirecting...</title>
</head>

<body>
    <p>If you are not redirected, <a href="configpage.hbs">click here</a>.</p>
</body>

</html>

after all this now Get Started button is coming

On clicking on Get Started redirected to /my-post-install-page but nothing is happening here loader is loading and after some time getting this error

Something’s gone wrong
Our team has been notified. If the problem persists, please contact Atlassian Support.

Can you please let me know what I’m missing here???

this page is a standard connect page and requires the “all.js” and such. if you dont complete the connect handshake with a load to all.js you will systematically fail to load the page in the frame.

once the page is loaded you will need to do a proper javascript AP.navigate.go() call that uses an appropriate app key (defined in your descriptor) in order to change the contents of the app frame.

if you wish to open a new tab with some external page your loaded page should use some appropriate JS window navigation once its loaded.

1 Like

Thanks @ibuchanan @eriklebel for the help. It worked

1 Like