ACJS - "Cannot decode webItem anchor" Error when using Connect and Forge together

We have a jira cloud add-on which we want to migrate from Connect to Forge.

I have followed instructions from Connect and Forge together | Developer Day 2021 and have the connect App ported as a Connect on Forge App installed on my dev instance. The installation is successful.

However I get the below error when I click the Web-Item embedded in the jira.agile.board.tools section . The same works perfectly as a standalone Connect App.

Forge Manifest file below -

modules:
  jira:workflowValidator:
    - key: example-workflow-validator
      function: main
      name: Workflow validator sample
      description: A Jira workflow validator example.
  function:
    - key: main
      handler: index.run
connectModules:
  {
    "jira:dialogs":
      [
        {
            "url": "/index.html?board.id={board.id}",
            "options":
              {
                "width": "100%",
                "height": "100%",
                "size": "maximum",
                "chrome": true,
                "cancelText": "Close"
              },
            "key": "dialog-module-key"
          },
        {
            "url": "/index.html?board.id={board.id}/#/standup",
            "options":
              {
                "width": "100%",
                "height": "100%",
                "size": "maximum",
                "chrome": true,
                "cancelText": "Close"
              },
            "key": "dialog-module-key-1"
          }
      ],
    "jira:webSections":
      [
        {
            "key": "view26-board-menu",
            "location": "jira.agile.board.tools",
            "name": { "value": "Team Manager" }
          }
      ],
    "jira:webItems":
      [
        {
            "location": "jira.software.board.tools",
            "weight": 200,
            "styleClasses": [ "webitem", "system-present-webitem" ],
            "context": "addon",
            "target":
              {
                "type": "dialogmodule",
                "options": { "key": "dialog-module-key" }
              },
            "tooltip": { "value": "Backlog Readme" },
            "icon":
              {
                "width": 24,
                "height": 24,
                "url": "/app/images/pie.svg"
              },
            "name": { "value": "Team-Manager" },
            "key": "web-item-backlog"
          },
        {
            "location": "view26-board-menu",
            "weight": 200,
            "styleClasses": [ "webitem", "system-present-webitem" ],
            "context": "addon",
            "target":
              {
                "type": "dialogmodule",
                "options": { "key": "dialog-module-key" }
              },
            "tooltip": { "value": "Backlog Readme" },
            "icon":
              {
                "width": 24,
                "height": 24,
                "url": "/app/images/pie.svg"
              },
            "name": { "value": "Daily Standup" },
            "key": "web-item-backlog-agile"
          },
        {
            "location": "view26-board-menu",
            "weight": 300,
            "styleClasses": [ "webitem", "system-present-webitem" ],
            "context": "addon",
            "target":
              {
                "type": "dialogmodule",
                "options": { "key": "dialog-module-key-1" }
              },
            "tooltip": { "value": "Backlog Readme" },
            "name": { "value": "Standup Details" },
            "key": "web-item-backlog-agile-1"
          }
      ],
    "jira:lifecycle":
      [
        { "key": "connect-lifecycle", "installed": "/installed" }
      ]
  }

remotes:
  - key: connect
    baseUrl: https://a6c6ca4c9343.ngrok.io
permissions:
  scopes: [ "read:connect-jira" ]
app:
  id: ari:cloud:ecosystem::app/08e4a861-48dd-4a11-8248-f1481396a733
  name: Team Manager connect on forge

Hi @ajay ,

I think this error is coming from here. It only goes into this path if there’s hash fragment in the webitem URL. I wonder if the leading/ in your /index.html?board.id={board.id}/#/standup webitem URL hash fragment is causing the issue?

Regards,
Dugald

2 Likes

Hi @dmorrow ,

That did the trick… I removed the URL hash fragment and finally have the Connect App working on Forge. In hindsight, shouldnt the connect json validation be handled before deployment?

Thanks a lot for the pointer and help ! Appreciate it :innocent:

Regards
Ajay

1 Like

Hi @ajay ,

Yes, I think there’s a bug on our side that I’ll follow up on.

Regards,
Dugald

1 Like