How do you decorate custom Jira Cloud pages with the Jira header and navigation elements?

I’m developing a Jira Cloud app. I’ve added a web item to Jira Cloud like so:

"webItems": [
  {
    "url": "/configure.html?key=configure--configurePage"
    "location": "system.admin/system",
    "context": "addon",
    "weight": 200,
    "target": {
      "type": "page"
    },
    "name": {
      "value": "My Configure Screen"
    },
    "key": "configure--system-admin--system",
    "conditions": [
      {
        "condition": "user_is_admin"
      }
    ]
  }
]

This appears in the “Other” section in Jira Settings / Apps, which is fine.

I’ve also created the following adminPage + configurePage (one of) which should support the link

"adminPages": [
  {
    "url": "/configure.html?key=configure--adminPages"
    "key": "configure--adminPages",
    "conditions": [
      {
        "condition": "user_is_admin"
      }
    ],
    "name": {
      "value": "My Admin/Configure Screen"
    }
  }
],
"configurePage": {
  "url": "/configure.html?key=configure--configurePage"
  "key": "configure--configurePage",
  "conditions": [
    {
      "condition": "user_is_admin"
    }
  ],
  "name": {
      "value": "My Admin/Configure Screen"
  }
},

However, when I follow the link, it goes to:

https://instance.atlassian.net/plugins/servlet/ac-redirect/my.app.key/configure--system-admin--system

Which is a redirect to:

https://mydomain.dev/path/to/my/app/baseUrl/configure.html?key=configure--configurePage

I would have expected that this should wrap my page in an iframe within the Jira chrome - at the very least giving the Jira header. This is the behaviour I’m seeing when building a Confluence Cloud app, but it’s entirely different for Jira Cloud.

What am I doing wrong?

1 Like

OK, I got this.

On https://developer.atlassian.com/cloud/jira/platform/modules/web-item/ it says:

targets a Page module by specifying the Page’s module key as the URL

So the web item becomes:

"webItems": [
  {
    "url": "configure--adminPages",  /********* key for the adminPage *********/
    "location": "system.admin/system",
    "context": "page", /********* changed from addon *********/
    "weight": 200,
    "target": {
      "type": "page"
    },
    "name": {
      "value": "My Configure Screen"
    },
    "key": "configure--system-admin--system",
    "conditions": [
      {
        "condition": "user_is_admin"
      }
    ]
  }
]

The changed lines have /********* ... *********/ next to them.

…to reference this:

"adminPages": [
  {
    "url": "/configure.html?key=configure--adminPages"
    "key": "configure--adminPages",
    "conditions": [
      {
        "condition": "user_is_admin"
      }
    ],
    "name": {
      "value": "My Admin/Configure Screen"
    }
  }
]