I’m running into issues with Atlassian Connect, using the javascript API.
I have a descriptor with a simple webitem
{
"name": "Create Branch",
"description": "Adds a button to issue tools to create a branch",
"key": "com.example.create-branch",
"baseUrl": "https://6026-86-88-172-152.ngrok.io",
"vendor": {
"name": "Example",
"url": "https://example.com"
},
"authentication": {
"type": "none"
},
"scopes": [ "READ" ],
"apiVersion": 1,
"modules": {
"webItems": [
{
"key": "create-branch-tools-item",
"location": "operations-operations",
"weight": 10,
"name": {
"value": "Create branch"
},
"url": "/create-branch.html?issueKey={issue.key}&issueTypeId={issuetype.id}"
}
]
}
}
This causes a click of the Create branch button to open ‘create-branch.html’, so far so good. It opens a the page as expected.
My page loads using the following contents.
<!DOCTYPE html>
<html lang="en">
<head>
<!--<link rel="stylesheet" href="https://unpkg.com/@atlaskit/css-reset@2.0.0/dist/bundle.css" media="all">-->
<script src="https://connect-cdn.atl-paas.net/all.js"></script>
</head>
<body>
<script>
window.onload = function () {
debugger;
}
</script>
</body>
</html>
It breaks on debugger, so I can inspect my scope. Now when I look at window.AP, which supposedly comes from https://connect-cdn.atl-paas.net/all.js, I would expect there to be functions like ‘request’, to get more info from my instance. But my AP object is very limited, when doing examples like AP.request(etc…) I always get not found.
Here is an example of what my AP object looks like:
What am I doing wrong here?