Retrieve the context from an archived case

Hi everyone,

I’m using Bonita 7.3.3, and my concern deals with a custom overview page for both active and archived cases.

I succeed on making one for an active case (when I select a task and go to the third tab), but I can’t figure it out when it comes to archived cases.

I understood that the API has to be built differently.
For the next example, “caseId”, usually an URL parameter type valued “id”, is set to 49001.

When the case 49001 is active, I’m using […/API/bpm/case/49001/context]. This works just fine.
The I end this case and, following the documentation, I’m using […/API/bpm/archivedCase?c=1&d=started_by&d=processDefinitionId&f=sourceObjectId%3D{{caseId}}&p=0 ] to check if the caseId references to an archived one.

It does.
It gives me a JSON containing the sourceObjectId (which was the id when the case was still active) and the id I need:
[…]
“sourceObjectId”:"49001",
“searchIndex3Label”:“”,
“startedBySubstitute”:“4”,
“searchIndex5Value”:“”,
“searchIndex2Value”:“”,
“rootCaseId”:“49001”,
“id”:“144003”,
[…]

Then, I reach the following URL to get the similar JSON I’m using for active cases, and i get exactly what i need: http://localhost:8080/bonita/API/bpm/archivedCase/144003/context.

My question is:
How can i retrieve the id (144003 in the URL above) of the archived case? I get nothing if I try to create a new variable called “archivedCaseId” value “ var.id”.

Does anyone have any suggestion, or a lead to follow?
Thank you.

Regards,

I’m just dumb.

Trying to make myself clear shown me what i did wrong.

var1 = …/API/bpm/archivedCase?c=1&d=started_by&d=processDefinitionId&f=sourceObjectId%3D49001&p=0.

The context has to be retrieved with this variable:
var2 = …/API/bpm/archivedCase/{{var1[0].id}}/context

Sorry for the useless post, and thank you all for your work.

Regards,

thank you for sharing,

regards