I followed the getting-started guide to create the helloworld basic app and integrated it successfully in my jira cloud instance.
Now I wanted to make an API request to get the issues for one of my boards. But the request failed with the 403 status.
I wanted to make the code as simple as possible, so I started with extending the helloworld.html with some javascript.
Here is the code:
<!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" async></script>
</head>
<body>
<section id="content" class="ac-content">
<h1>Hello World</h1>
<button id="fetchButton">fetch</button>
</section>
</body>
<script>
function fetchData() {
AP.request('/rest/agile/1.0/board/1/issue')
.then(data => {
console.log('response data', data);
})
.catch(e => console.error(e.err));
}
document.getElementById('fetchButton').onclick = fetchData;
</script>
</html>
The browser log after doing the request above :
…
I cant show it here as this forum says “New users can only put 2 links in a message”.