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:
@@ -1770,8 +1770,15 @@ function QueuePanel({ open, items, onClose, onUpdate, onDelete, onDeleteMany, on
|
|||||||
const firstCve = (Array.isArray(cves) && cves.length > 0) ? cves[0] : '';
|
const firstCve = (Array.isArray(cves) && cves.length > 0) ? cves[0] : '';
|
||||||
const summary = (item.finding_title || '').slice(0, 255);
|
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 = '';
|
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') {
|
if (item.workflow_type === 'Remediate') {
|
||||||
try {
|
try {
|
||||||
const notesRes = await fetch(`${API_BASE}/ivanti/todo-queue/${item.id}/notes`, { credentials: 'include' });
|
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();
|
const notes = await notesRes.json();
|
||||||
if (notes.length > 0) {
|
if (notes.length > 0) {
|
||||||
const sorted = [...notes].sort((a, b) => new Date(a.created_at) - new Date(b.created_at));
|
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) {
|
for (const note of sorted) {
|
||||||
const date = note.created_at ? note.created_at.slice(0, 10) : 'Unknown';
|
const date = note.created_at ? note.created_at.slice(0, 10) : 'Unknown';
|
||||||
description += `[${date}] ${note.username}: ${note.note_text}\n`;
|
description += `[${date}] ${note.username}: ${note.note_text}\n`;
|
||||||
|
|||||||
Reference in New Issue
Block a user