im having some strange behavior with this job query in an execution listener Javascript at camunda 7.16:
execution.getProcessEngineServices().getManagementService().createJobQuery()
.activityId(execution.getCurrentActivityId())
.processInstanceId(execution.getProcessInstanceId())
.singleResult()
.getRetries();
even if my task is with Retry Time Cycle “R5/PT10S” or “R1/PT10S” the job query always returns 3 in the first try and decrement…
in my script im trying to throw a BpmnError when i get to retries 1, and this works for most cases… but if i set R1/PT10S it opens an incident… because the jobquery returns 3, but camunda opens an incident in the first try