Hi Tory,
You can do it using the Rundeck API, jq tool, and some standard UNIX tools.
You need to call only the succeeded jobs in this way:
curl -s --location --request GET 'http://localhost:4440/api/37/job/76026d48-b728-4181-bb3f-5447ebba4a71/executions?status=succeeded' \
--header 'Accept: application/json' \
--header 'X-Rundeck-Auth-Token: tMkuJrY109liJUXACcr30NvzX6ieaBYo' \
--header 'Content-Type: application/json'
Now, using jq, grep and wc to get the amount of succeeded executions:
curl -s --location --request GET 'http://localhost:4440/api/37/job/76026d48-b728-4181-bb3f-5447ebba4a71/executions?status=succeeded' \
--header 'Accept: application/json' \
--header 'X-Rundeck-Auth-Token: tMkuJrY109liJUXACcr30NvzX6ieaBYo' \
--header 'Content-Type: application/json' jq | grep "status" | wc -l
Of course, you can create a better script like:
host="localhost"
port="4440"
jobid="76026d48-b728-4181-bb3f-5447ebba4a71"
status="succeeded"
rdeck_token="tMkuJrY109liJUXACcr30NvzX6ieaBYo"
execs=$(curl -s --location --request GET "http://$host:$port/api/37/job/$jobid/executions?status=$status" \
--header "Accept: application/json" \
--header "X-Rundeck-Auth-Token: $rdeck_token" \
--header "Content-Type: application/json" | jq | grep "status" | wc -l)
echo "Succeeded excutions $execs"
Output (Activity panel):
Succeeded excutions 4
Hope it helps!