fix: correct subjectFilterRequest format for Ivanti FP workflow API

The API expects { subject: 'hostFinding', filterRequest: { filters } }
not a flat filter object. Confirmed working via direct curl test —
workflow ID 33418832 created successfully.
This commit is contained in:
jramos
2026-04-08 12:18:41 -06:00
parent 5d417edf82
commit 729dada05c

View File

@@ -75,19 +75,19 @@ function validateFpWorkflowForm(body) {
/** /**
* Builds the subjectFilterRequest JSON for the Ivanti FP workflow endpoint. * Builds the subjectFilterRequest JSON for the Ivanti FP workflow endpoint.
* This is a stringified filter that tells Ivanti which host findings to include. * Format: { subject, filterRequest: { filters } }
* Format matches the search endpoint filter schema: { filters, projection, sort }
*/ */
function buildSubjectFilterRequest(findingIds) { function buildSubjectFilterRequest(findingIds) {
return JSON.stringify({ return JSON.stringify({
filters: [{ subject: 'hostFinding',
field: 'id', filterRequest: {
exclusive: false, filters: [{
operator: 'IN', field: 'id',
value: findingIds.map(id => String(id)).join(',') exclusive: false,
}], operator: 'IN',
projection: 'internal', value: findingIds.map(id => String(id)).join(',')
sort: [{ field: 'id', direction: 'ASC' }] }]
}
}); });
} }