Error creating a customContent on a confluence addon

157 Views Asked by At

Today I was trying to create a confluence addon for my company and I've try following atlassian documents.

My problem comes trying to run the express app when adding a new customContent to the atlassian-connect.json, after running npm start I get the following error.

Failed to register with host https‍://admin:[email protected]/wiki (200) {"type":"INSTALL","pingAfter":300,"status":{"done":true,"statusCode":200,"con tentType":"application/vnd.atl.plugins.task.install.err+json","subCode":"upm. pluginInstall.error.descriptor.not.from.marketplace","source":"https‍://1a0adc 8f.ngrok.io/atlassian-connect.json","name":"https‍://1a0adc8f.ngrok.io/atlassi an-connect.json"},"links":{"self":"/wiki/rest/plugins/1.0/pending/b88594d3-c3 c2-4760-b687-c8d860c0a377","alternate":"/wiki/rest/plugins/1.0/tasks/b88594d3 -c3c2-4760-b687-c8d860c0a377"},"timestamp":1502272147602,"userKey":"xxx","id":"xxx"}
Add-on not registered; no compatible hosts detected

This is my atlassian-connect.json file:

{
"key": "my-add-on",
"name": "Ping Pong",
"description": "My very first add-on",
"vendor": {
    "name": "Angry Nerds",
    "url": "https://www.atlassian.com/angrynerds"
},
"baseUrl": "{{localBaseUrl}}",
"links": {
    "self": "{{localBaseUrl}}/atlassian-connect.json",
    "homepage": "{{localBaseUrl}}/atlassian-connect.json"
},
"authentication": {
    "type": "jwt"
},
"lifecycle": {
    "installed": "/installed"
},
"scopes": [
    "READ"
],
"modules": {
    "generalPages": [
        {
            "key": "hello-world-page-jira",
            "location": "system.top.navigation.bar",
            "name": {
                "value": "Hello World"
            },
            "url": "/hello-world",
            "conditions": [{
                "condition": "user_is_logged_in"
            }]
        },
        {
            "key": "customersViewer",
            "location": "system.header/left",
            "name": {
                "value": "Hello World"
            },
            "url": "/hello-world",
            "conditions": [{
                "condition": "user_is_logged_in"
            }]
        }
    ],
    "customContent": [
        {
            "key": "customer",
            "name": {
                "value": "Customers"
            },
            "uiSupport": {
                "contentViewComponent": {
                    "moduleKey": "customersViewer"
                },
                "listViewComponent": {
                    "moduleKey": "customerList"
                },
                "icons": {
                    "item": {
                        "url": "/images/customers.png"
                    }
                }
            },
            "apiSupport": {
                "supportedContainerTypes": ["space"]
            }
        }
    ]
}
}

Does anybody has an idea on whats going on?

1

There are 1 best solutions below

1
RedWolves On

The contentViewComponent can't find the generalPage it is referencing in moduleKey.

From the docs:

In the snippet above, the moduleKey “customersViewer” maps to a generalPage module we have defined in our add-on. This generalPage is passed the context parameters we specify, and visualizes our content accordingly.

If you change the generalPage with the key hello-world-page-confluence to customersVieweryou be able to install and get up and running.