Hi, I am working with JIRA Forge, I have created a forge application (context as jira, category as UI Kit, template as jira-global-page). After forge application has been created successfully, I have updated below code in 'C:\Users\inayatulla.shaik\OneDrive - ClarioClinical\fetchIssues7DaysLast\src\resolvers\index.js ===========================================================
import api,{ route} from "@forge/api";
import Resolver from "@forge/resolver";
const resolver = new Resolver();
resolver.define("fetchIssues", async () => {
// The JQL query to find issues created in the last 7 days
const jql = "created >= -7d ORDER BY created DESC";
try {
// console.log(route)
const response = await api.asApp().requestJira(route`/rest/api/3/search?jql=${jql}`);
const data = await response.json();
console.log(data)
return data.issues;
} catch (error) {
console.error("Error fetching issues:", error);
return [];
}
});
export const handler = resolver.getDefinitions();
===========================================================I have updated below code at 'C:\Users\inayatulla.shaik\OneDrive - ClarioClinical\fetchIssues7DaysLast\src\frontend/index.jsx'
import React, { useEffect, useState } from 'react';
import ForgeReconciler, { Text, Heading, Button, Box, Table, Head, Cell, Row, xcss } from '@forge/react';
import { invoke } from '@forge/bridge';
const App = () => {
const [issues, setIssues] = useState([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
const fetchRecentIssues = async () => {
const fetchedIssuesfetched = await invoke('fetchIssues');
setIssues(fetchedIssuesfetched);
setLoading(false);
};
fetchRecentIssues();
}, []);
if (loading) {
return <Text>Loading issues...</Text>;
}
if (!issues || issues.length === 0) {
return <Text>No issues found from the last 7 days.</Text>;
}
return (
<Box padding="space.200">
<Heading as="h2">Recently Created Issues (Last 7 Days)</Heading>
<Table>
<Head>
<Cell>
<Text weight="semibold">Key</Text>
</Cell>
<Cell>
<Texqt weight="semibold">Summary</Text>
</Cell>
<Cell>
<Text weight="semibold">Created</Text>
</Cell>
<Cell>
<Text weight="semibold">Status</Text>
</Cell>
</Head>
<tbody>
{issues.map(issue => (
<Row key={issue.key}>
<Cell>
<Text>{issue.key}</Text>
</Cell>
<Cell>
<Text>{issue.fields.summary}</Text>
</Cell>
<Cell>
<Text>{new Date(issue.fields.created).toLocaleDateString()}</Text>
</Cell>
<Cell>
<Text>{issue.fields.status.name}</Text>
</Cell>
</Row>
))}
</tbody>
</Table>
</Box>
);
};
ForgeReconciler.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
=========================================================
After applying above two changes, I have deployed and install the JIRA Forge application into JIRA Cloud. I have logged into JIRA Cloud and try to access the forge application named 'fetchIssues7DaysLast'. I did not see expected output When I inspect the page I can see below error, I believe Atlassian Development support team can only help in this regard, so please help me out.
Below is what error details
======================
If your deployed JIRA Forge App is getting 404 Not Found error from
https://api.atlassian. com/metal/digest, it is likely an internal platform issue related to Forge's telemetry, and not a problem with your app's code. the /metal/ingest end point used by Atlassian's systems for internal logging and analytics. The issue has been reported by other developers and usually resolved itself or requires intervention from Atlassian's developer support team.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.