Wrap enriched and skipped ticket keys in markdown links using JIRA_BASE_URL so keys are clickable in the hourly poller room summary. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
915 B
JavaScript
28 lines
915 B
JavaScript
// services/jiraPoller/formatSummary.js
|
|
//
|
|
// Pure formatters for the hourly poller Webex summary message.
|
|
|
|
import { formatJiraIssueMarkdownLink } from '../../utils/jiraBrowseUrl.js';
|
|
import { iconForTicket } from './ticketIcons.js';
|
|
|
|
/**
|
|
* @param {{ key: string, summary: string, storeNum: string, kind: string, reason: string, components?: Array<{name?: string}> }} ticket
|
|
* @returns {string}
|
|
*/
|
|
export function formatEnrichedTicketLine(ticket) {
|
|
const icon = iconForTicket(ticket.components, ticket.kind);
|
|
const keyLink = formatJiraIssueMarkdownLink(ticket.key);
|
|
|
|
return (
|
|
`• ${icon} ${keyLink} [store ${ticket.storeNum}] — ${ticket.summary}\n` +
|
|
` _AI: ${ticket.reason}_`
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @param {{ key: string, reason: string }} skipped
|
|
* @returns {string}
|
|
*/
|
|
export function formatSkippedTicketRef(skipped) {
|
|
return `${formatJiraIssueMarkdownLink(skipped.key)} (${skipped.reason})`;
|
|
}
|