Hello my friend! Welcome to community \o ![]()
This script that Iām sending below can be used in an execution listner, or in a script task, or even directly in your projectās code (with a few modifications):
var retriesNumber = execution.getProcessEngineServices().getManagementService()
.createJobQuery()
.activityId(execution.getCurrentActivityId())
.singleResult()
.getRetries();
Although you can execute the necessary logic, I believe you will not be able to āprintā the amount of retry in a process variable, for example, because this functionality has been buggy since 2018, I think from what Iāve heard.
In this post below, in the last comment, I talked a little about this subject.
But if you just need to run some logic like you mentioned it will work!
I hope this helps!
William Robert Alves