Fix empty description in single-item Jira modal on ReportingPage

openCreateJiraFromQueue only populated the description for Remediate
workflow items. Non-Remediate items got an empty string, while multi-select
worked because it used generateConsolidatedDescription via ConsolidationModal.

Now always includes finding info (vendor, title, CVEs, host/IP) in the
description for all workflow types. Remediate items still append their
notes below.
This commit is contained in:
Jordan Ramos
2026-06-09 08:31:01 -06:00
parent 4d8a6b9c6e
commit 2396a828cc

View File

@@ -1770,8 +1770,15 @@ function QueuePanel({ open, items, onClose, onUpdate, onDelete, onDeleteMany, on
const firstCve = (Array.isArray(cves) && cves.length > 0) ? cves[0] : '';
const summary = (item.finding_title || '').slice(0, 255);
// Build description — include remediation notes for Remediate items
// Build description — include finding details and remediation notes for Remediate items
let description = '';
// Always include finding info in description
const cveList = (Array.isArray(cves) && cves.length > 0) ? cves.join(', ') : 'None';
description += `== ${item.vendor || 'Unknown Vendor'} ==\n`;
description += `- ${item.finding_title || 'Untitled'}\n`;
description += ` CVEs: ${cveList}\n`;
description += ` Host: ${item.hostname || 'N/A'} (${item.ip_address || 'N/A'})\n`;
if (item.workflow_type === 'Remediate') {
try {
const notesRes = await fetch(`${API_BASE}/ivanti/todo-queue/${item.id}/notes`, { credentials: 'include' });
@@ -1779,7 +1786,7 @@ function QueuePanel({ open, items, onClose, onUpdate, onDelete, onDeleteMany, on
const notes = await notesRes.json();
if (notes.length > 0) {
const sorted = [...notes].sort((a, b) => new Date(a.created_at) - new Date(b.created_at));
description = '== Remediation Notes ==\n';
description += '\n== Remediation Notes ==\n';
for (const note of sorted) {
const date = note.created_at ? note.created_at.slice(0, 10) : 'Unknown';
description += `[${date}] ${note.username}: ${note.note_text}\n`;