I have created a app to export issues.
But I am facing issues while deploying it I will share my manifest.yml and index.js file and also the error please help me resolve this.
manifest file
modules:
jira:issueNavigatorAction:
- key: export-issues-action
title: Export All Issues
icon: https://developer.atlassian.com/platform/forge/images/export.svg
resource: main
resolver:
function: resolver
render: native
function:
- key: resolver
handler: index.handler
resources:
- key: main
path: static/index.html
tunnel:
port: 3000
app:
id: ari:cloud:ecosystem::app/d3cf4dcf-ad4f-4e4d-ba80-bbab6a288e4d
runtime:
name: nodejs20.x
permissions:
scopes:
- read:jira-work
- read:jira-user
- read:issue-details:jira
index file
const api = require(â@forge/apiâ);
exports.handler = async (req) => {
const jql = âORDER BY created DESCâ;
const response = await api.asApp().requestJira(/rest/api/3/search?jql=${encodeURIComponent(jql)}&maxResults=50
);
const data = await response.json();
const issues = data.issues.map(issue => ({
key: issue.key,
summary: issue.fields.summary,
status: issue.fields.status.name,
assignee: issue.fields.assignee?.displayName || âUnassignedâ,
reporter: issue.fields.reporter.displayName,
created: issue.fields.created
}));
const csv = [
[âKeyâ, âSummaryâ, âStatusâ, âAssigneeâ, âReporterâ, âCreatedâ],
âŠissues.map(i => [i.key, i.summary, i.status, i.assignee, i.reporter, i.created])
].map(row => row.map(field => "${field}"
).join(â,â)).join(â\nâ);
return new Response(csv, {
headers: {
âContent-Typeâ: âtext/csvâ,
âContent-Dispositionâ: âattachment; filename=âissues.csvââ
}
});
};
and this is the error
D:\forge-export-csv\manifest.yml
13:15 error function handler property âindex.handlerâ cannot find associated file with name âindex.jtâ valid-module-required