I can't get a response to the request

I’m trying to make a call to an internal Jira endpoint using the fetch function from the React code of a Forge app I have installed on a test Jira Cloud, but I’m having trouble getting the response. The call I am trying to make is a simple call to an internal Jira endpoint that when I monitor the traffic there is a response but when I do it from Forge using Fetch problems arise. What is the problem?

Correctly receiving the response when interacting with the Jira Cloud interface


I can’t get the response from the Forge app code:

fetch('https://wiqu-development.atlassian.net/rest/greenhopper/1.0/rapidviews/recent?maxResults=1&userBoard=true', {
       mode: "no-cors",
       credentials: 'include',
       headers: {
            'Authorization': 'Basic <redacted>',
    }}).then(r => { console.log(r) });

If you have any questions or additional information you need to answer me, let me know.

Hi @CristinaLaraLpez,

Since the endpoint you are trying to call is not a public REST API, it will not work as it would when accessing via browser. That said, have you checked Jira Software’s REST APIs specifically the Board APIs if any of these returns the data you need? What is the specific information that you need?

Also, I would advise that you revoke the API Token you used for this post as you might’ve accidentally pasted it in the code snippet (decoding a base64 encoded string is easy to do). I already modified your post to redact the base64 encoded email:apiToken pair.

Cheers,
Ian

1 Like