import React, { useEffect, useState } from 'react';
import {
Text,
useProductContext,
useAction,
SectionMessage,
LoadingSpinner,
} from '@forge/react';
import { invoke } from '@forge/bridge';
const App = () => {
const context = useProductContext();
const [issue, setIssue] = useState(null);
const [error, setError] = useState(null);
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
async function getIssueDetails() {
try {
if (!context?.issueId) {
setError('Could not get issue ID from context.');
setIsLoading(false);
return;
}
const response = await invoke('getIssueDetails', {
issueId: context.issueId,
});
if (response.error) {
setError(response.error);
} else {
setIssue(response);
}
}catch (err) {
console.error('Error fetching issue details:', err);
setError('An unexpected error occurred.');
} finally {
setIsLoading(false);
}
}
getIssueDetails();
}, [context]);
if (isLoading) {
return <LoadingSpinner />;
}
if (error) {
return (
<SectionMessage appearance="error" title="Could not load issue details">
<Text>{error}</Text>
</SectionMessage>
);
}
return (
<>
{issue ? (
<>
<Text>
<b>Issue Summary:</b> {issue.fields.summary}
</Text>
<Text>
<b>Reporter:</b> {issue.fields.reporter.displayName}
</Text>
</>
) : (
<Text>No issue details found.</Text>
)}
</>
);
};
export const run = () => (
<App />
);
After this, I ran 'forge deploy' and 'forge install' commands
4. After that While I am trying to access the forge app from JIRA Issue Panel
no output is being shown on Jira Issue panel expect think while lines are appearing under the jira forge app name.
Please assist me why I am not getting expected out.
Thanking you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.