private async generateJiraPrompt()

in src/github/junie/new-prompt-formatter.ts [66:97]


    private async generateJiraPrompt(context: JunieExecutionContext): Promise<string> {
        const jira = context.payload as JiraIssuePayload;

        // Format comments
        const commentsInfo = jira.comments.length > 0
            ? '\n\nComments:\n' + jira.comments.map(comment => {
                const date = new Date(comment.created).toLocaleString('en-US', {
                    year: 'numeric',
                    month: 'short',
                    day: 'numeric',
                    hour: '2-digit',
                    minute: '2-digit'
                });
                return `[${date}] ${comment.author}:\n${comment.body}`;
            }).join('\n\n')
            : '';

        // Form the complete prompt text
        const promptText = `You were triggered as a GitHub AI Assistant by a Jira issue. Your task is to implement the requested feature or fix based on the Jira issue details below.

<jira_issue>
Issue Key: ${jira.issueKey}
Summary: ${jira.issueSummary}

Description: ${jira.issueDescription}${commentsInfo}
</jira_issue>
`;

        // Download all attachments referenced in text (single pass), then sanitize
        const promptWithAttachments = await downloadJiraAttachmentsAndRewriteText(promptText, jira.attachments);
        return sanitizeContent(promptWithAttachments);
    }