Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,104
Community Members
 
Community Events
165
Community Groups

Rest API calls fail with 404 and "The property isDevOpsProjects does not exist."

I have a very simple Forge app that is calling the Jira Cloud Platform Rest API. Note that I get the same behavior no matter what methods I call. I get a 404 "Not Found" error on all calls. But I am able to make the identical calls from Postman successfully. I've tried both asUser and asApp with the same results. When looking at the network calls I can see that my urls are getting changed to

"<my url>/properties/isDevOpsProjects"

and if I try hitting that with curl it returns the error 

"The property isDevOpsProjects does not exist.".

I've double checked all scopes and permissions and everything seems in order. What could be causing this. My code looks like the following:

import ForgeUI, { render, Text, ProjectPage, useState } from '@forge/ui';
import api, { route } from "@forge/api";

const App = () => {

    const requestUrl = `https://<my-domain>.atlassian.net/rest/api/3/project/STP`;

    const response = useState(async () => await getReponse(requestUrl));

    return (
        <ProjectPage>
        <Text>Hello, world! {JSON.stringify(response)}</Text>
        </ProjectPage>
    );
};

const getReponse = async (url) => {
    const res = await api.asApp().requestJira(route`${url}`,
    {
        headers: { 'Accept': 'application/json' }
    });
    return res.json();
};

export const run = render(
<App />
);

The response is

Hello, world! [{"timestamp":"2022-06-08T17:08:26.469193Z","status":404,"error":"Not Found","message":"No message available","path":"....https:/<my-domain>.atlassian.net/rest/api/3/project/STP"},null]

 

 

1 answer

1 accepted

1 vote
Answer accepted

Solved my own problem. 

requestUrl = `https://<my-domain>.atlassian.net/rest/api/3/project/STP`;

should be

requestUrl = `/rest/api/3/project/STP`;

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

51 views 1 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you