First touch with JIra Cloud development ( Help with basic please ) - Node Js

I am new in all of this so I have a some basic questions for a start with a Jira Cloud development.

  1. Can anyone make a basic example of sending GET and POST requests using AP.request(eg /rest/api/3/dashboard) --> ( for example in Issue Glance module)
  2. Where should the plugin code be placed in? public/js/addon.js or routes/index.js/? AP.request works only in addon.js and not in routes, but
    when I tried that I get a lot of 403 errors and I am confused about sending context variables to hbs files.
  3. How to authenticate AP requests, do I need to auth them at all using jwt?
  4. How to access Jira Issue details page

Hi Mateo,

  1. The following page in the documentation has some example requests that are usually good to go on:

  2. & 3) When building an app for Jira Cloud, it is important to keep in mind that your app lives in two places. It has a backend running on your server (or dev machine) and a frontend running in the browser of whoever uses the app. The frontend code is in public/js/* while the backend code might be in routes/*. When using Atlassian Connect Express, both are JavaScript, which can be a bit confusing at first.

The AP.request function is only available in the frontend part of your application. It typically doesn’t need any extra auth, as the person using your app will already be logged in. If you are getting 403 errors, one reason could be that the user accessing the resource doesn’t have the correct permission.

  1. The REST API endpoint for Jira issues is /rest/api/2/issue/{issueIdOrKey}, the documentation is here.

Without any further details on what you are trying to achieve and/or excerpts from your code, it is a bit hard to go into more details, but I do hope that was helpful for you.