Append remediation notes to Jira ticket description in QueuePanel
- Single-item: openCreateJiraFromQueue fetches notes for Remediate items and pre-fills the description with a Remediation Notes section - Multi-item: ConsolidationModal fetches notes for all Remediate items and appends them via appendRemediationNotes utility Previously notes were only integrated in IvantiTodoQueuePage.js but the actual Jira creation flow users interact with is in ReportingPage.js QueuePanel and ConsolidationModal.
This commit is contained in:
@@ -1759,7 +1759,7 @@ function QueuePanel({ open, items, onClose, onUpdate, onDelete, onDeleteMany, on
|
||||
};
|
||||
|
||||
// Open Create Jira modal pre-populated from a queue item
|
||||
const openCreateJiraFromQueue = (item) => {
|
||||
const openCreateJiraFromQueue = async (item) => {
|
||||
// Parse cves_json — it may be a JSON string or already an array
|
||||
let cves = [];
|
||||
if (item.cves_json) {
|
||||
@@ -1769,12 +1769,32 @@ 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
|
||||
let description = '';
|
||||
if (item.workflow_type === 'Remediate') {
|
||||
try {
|
||||
const notesRes = await fetch(`${API_BASE}/ivanti/todo-queue/${item.id}/notes`, { credentials: 'include' });
|
||||
if (notesRes.ok) {
|
||||
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';
|
||||
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`;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (_) { /* best-effort */ }
|
||||
}
|
||||
|
||||
setCreateJiraForm({
|
||||
summary,
|
||||
cve_id: firstCve,
|
||||
vendor: item.vendor || '',
|
||||
source_context: 'ivanti_queue',
|
||||
description: '',
|
||||
description,
|
||||
project_key: '',
|
||||
issue_type: '',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user