Atlassian-connect.json - web item module url change

Since 2 days ago we have been receiving reports that our customers can’t access one of the app’s page

We haven’t change anything recently. After some investigation it turned out that the url contains additional slash before “config” part, i.e. - Jira

If an additional slash is removed, you can access the page.

Our config:

"webItems": [
      {
        "location": "admin_plugins_menu/issue-templates-web-section",
        "weight": 200,
        "url": "/config-page",
        "context": "page",
        "name": {
          "value": "Configuration"
        },
        "key": "config-page-web-item"
      },

As a workaround we will change the url as follow: (remove slash)

"webItems": [
      {
        "location": "admin_plugins_menu/issue-templates-web-section",
        "weight": 200,
        "url": "config-page",
        "context": "page",
        "name": {
          "value": "Configuration"
        },
        "key": "config-page-web-item"
      },

Have the change been announced? I have checked the documentation and in the example, there is a slash in url. We are confused what happened and wondering whether we should expect more changes in atlassian-connect.json regarding urls in other modules.

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

4 Likes

@maciej.dudziak I can’t recall a specific change in that area that would explain this change in behavior, but your Web Item module should never have worked. The new behavior is correct.

I have checked the documentation and in the example, there is a slash in url.

You are right about that. But the example uses a different context than your Web Item. Condensed, it becomes:

"webItems": [
   { 
      "key": "web-item-example",
      "context": "addon",
      "url": "/my-web-item"
   }
]

From the API documentation:

context: The context for the URL parameter

  • addon - a URL relative to the add-on’s base URL
  • page - targets a Page module by specifying the Page’s module key as the URL
  • product - a URL relative to the product’s base URL

In your case, setting context to page requires providing the key of a Page module as the value of url, which you weren’t doing.

1 Like

Having "context": "addon" we experience the same issue.

Out web item:

      {
        "location": "system.top.navigation.bar",
        "context": "addon",
        "weight": 200,
        "target": {
          "type": "dialogmodule",
          "options": {
            "key": "issue-new-dialog"
          }
        },
        "key": "issue-new-link",
        "conditions": [
          {
            "condition": "user_is_logged_in"
          },
          {
            "condition": "addon_is_licensed"
          }
        ],
        "icon": {
          "width": 24,
          "height": 24,
          "url": "/light.svg"
        },
        "name": {
          "value": "Open the dialog"
        }
      }

Can the target cause the problem?

Thanks for help @epehrson :handshake:

1 Like

@dorialan, I don’t understand how this would be the same issue, since Web Items with target set to dialogmodule can’t have a url. The issue might be related, but I’d prefer if you created a new thread.

I looked closer to the documentation and you are right, it does not make sense that it worked. Now I am wondering why it was implemented like that back then - the last commit was back in 10.03.2017 :smiley:. Anyway, thank you kindly for help!

Small edit: not sure how it worked, but we also had a config page with key: config-page. I am guessing that Jira could somehow match those, even if the key was not exactly the same

While I understand that the documentation is technically correct, it is still quite confusing. A small addition to the documentation like:

page - targets a Page module by specifying the Page’s module key (without a leading slash) as the URL

(without a leading slash)

@marc, I don’t know about that. The allowed character set for the key field is [a-zA-Z0-9-], so calling out that you shouldn’t include a slash seems odd.

I think the documentation is technically correct, however I think confusion comes because it says

by specifying the Page’s module key as the URL

By reading to quickly you might think URL = has leading slash. In fact, the module key is not an URL, but has to be specified as the URL.