Calling Jira Cloud REST API methods from Confluence Cloud plug-in

Hello,
We are migrating our Confluence Cloud plug-in from App impersonation to User impersonation (addin ACT_AS_USER scope and so on). We’ve successfully got a token and got a response from Confluence API. But when we are trying to call linked Jira REST API methods, it always returns 403 error.
So, the questions are:

  1. When we specify a bearer token, is it needed to generate JWT token as well?
  2. If yes, how we should specify it in the request?
  3. Should we generate QSH somehow?
  4. If yes, how we should specify it in the request?
    Thanks!

A Confluence cloud app cannot call Jira REST APIs. You need to have a separate Jira app with the ACT_AS_USER scope and then request an OAuth2 token with Jira app. If you are making these calls from your backend then the Confluence app can find a matching Jira app using the site base URL and use the same user accountId for making the call as a Jira app.

Kind regards,
Raimonds

Hi Raimonds,

Thanks for the answer!

If REST API of other product cannot be called under current user, then:

  1. Why, when I try to call it from browser, I’ve got a successful response? I’ve checked the request, sent by the browser – it contains the same user id.
  2. Why Confluence Cloud products on the Marketplace, which suppose REST API calls to Jira (reporting tools, which return Jira issues) do not require installation of additional products to Jira (which is supposed to help with impersonation)?

Thanks!