fix: align subjectFilterRequest with Ivanti search filter schema

Remove extra fields (orWithPrevious, implicitFilters, subject) that
aren't in the Swagger filter schema. Add projection and sort fields
to match the search endpoint format.
This commit is contained in:
jramos
2026-04-08 12:08:08 -06:00
parent 03e60c9daf
commit 5d417edf82

View File

@@ -76,6 +76,7 @@ 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. * This is a stringified filter that tells Ivanti which host findings to include.
* Format matches the search endpoint filter schema: { filters, projection, sort }
*/ */
function buildSubjectFilterRequest(findingIds) { function buildSubjectFilterRequest(findingIds) {
return JSON.stringify({ return JSON.stringify({
@@ -83,11 +84,10 @@ function buildSubjectFilterRequest(findingIds) {
field: 'id', field: 'id',
exclusive: false, exclusive: false,
operator: 'IN', operator: 'IN',
orWithPrevious: false,
implicitFilters: [],
value: findingIds.map(id => String(id)).join(',') value: findingIds.map(id => String(id)).join(',')
}], }],
subject: 'hostFinding' projection: 'internal',
sort: [{ field: 'id', direction: 'ASC' }]
}); });
} }