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>
30 lines
768 B
JavaScript
30 lines
768 B
JavaScript
// services/jiraPoller/ticketIcons.js
|
|
//
|
|
// Component/kind → emoji mapping for poller Webex summary bullets.
|
|
|
|
export const COMPONENT_ICONS = {
|
|
'Mobility': '📱',
|
|
'Communication Services': '☎️',
|
|
'Audio Visual': '📺',
|
|
};
|
|
|
|
const KIND_ICONS = {
|
|
phone: '☎️',
|
|
av: '📺',
|
|
};
|
|
|
|
/**
|
|
* Pick the summary-bullet icon for a ticket.
|
|
* Prefer the first recognized Jira component; fall back to AI kind.
|
|
*
|
|
* @param {Array<{name?: string}>|null|undefined} components
|
|
* @param {'phone'|'av'|string} [kind]
|
|
* @returns {string}
|
|
*/
|
|
export function iconForTicket(components, kind) {
|
|
for (const c of components || []) {
|
|
const icon = COMPONENT_ICONS[c?.name];
|
|
if (icon) return icon;
|
|
}
|
|
return KIND_ICONS[kind] || '🎫';
|
|
}
|