diff --git a/src/main/wrapper/CxWrapper.ts b/src/main/wrapper/CxWrapper.ts index ccd61842..ba1d7ca2 100644 --- a/src/main/wrapper/CxWrapper.ts +++ b/src/main/wrapper/CxWrapper.ts @@ -200,11 +200,11 @@ export class CxWrapper { return await exec.executeCommands(this.config.pathToExecutable, commands, CxConstants.PREDICATE_TYPE); } - async triageUpdate(projectId: string, similarityId: string, scanType: string, state: string, comment: string, severity: string, stateId = ""): Promise { + async triageUpdate(projectId: string, similarityId: string, scanType: string, state: string, comment: string, severity: string, stateId:number|null = null): Promise { const commands: string[] = [CxConstants.CMD_TRIAGE, CxConstants.SUB_CMD_UPDATE, CxConstants.PROJECT_ID, projectId, CxConstants.SIMILARITY_ID, similarityId, CxConstants.SCAN_TYPES_SUB_CMD, scanType, CxConstants.STATE, state, CxConstants.COMMENT, comment, CxConstants.SEVERITY, severity]; if(stateId) { commands.push(CxConstants.STATE_ID) - commands.push(stateId) + commands.push(stateId.toString()) } commands.push(...this.initializeCommands(false)); const exec = new ExecutionService(); diff --git a/src/tests/PredicateTest.test.ts b/src/tests/PredicateTest.test.ts index 3f8bbad5..ffa7b708 100644 --- a/src/tests/PredicateTest.test.ts +++ b/src/tests/PredicateTest.test.ts @@ -31,7 +31,7 @@ describe("Triage cases", () => { expect(cxShow.exitCode).toEqual(0); } - const handleTriageUpdate = async (scan: any, result: CxResult, newState: string, newSeverity: string, newStateId = "") => { + const handleTriageUpdate = async (scan: any, result: CxResult, newState: string, newSeverity: string, newStateId: number|null = null ) => { const cxUpdate: CxCommandOutput = await auth.triageUpdate( scan.projectID, result.similarityId, result.type, newState, "Edited via JavascriptWrapper", @@ -87,6 +87,6 @@ describe("Triage cases", () => { await handleTriageUpdate(scan, result, CxConstants.STATE_CONFIRMED, CxConstants.SEVERITY_MEDIUM); } } - await handleTriageUpdate(scan, result, "", CxConstants.SEVERITY_MEDIUM, customStateId.toString()); + await handleTriageUpdate(scan, result, "", CxConstants.SEVERITY_MEDIUM, customStateId); }); }); \ No newline at end of file