CircleCI API approve

Hello there. I integrated a way to automatically approve my hold jobs based on some conditions. First I’m calling{id}/job to get the approval_request_id and afterwards I’m calling{id}/approve/approval_request_id in order to approve it. The problem is that inside the pipeline the response is “Job already approved.” even if the job wasn’t approved. If i’m making the call using Postman for the exact workflow and approval_request_id I get Accepted and the hold job is approved. Am I doing something wrong?

1 Like

Hi @Roxana006,

Thank you for sharing your issue on our forum!

Could you confirm for me if you are trying to approve an approval job in an upstream job?

If so, you will be unable to do so until the workflow has progressed until the point where the approval job is preventing further progression of the workflow. The error message shown is misleading however.

Hi @aaronclark :wave:

  1. The error message is still misleading (Job already approved.). Are there plans to fix that?

  2. The inability to approve upstream jobs creates an issue for our daily deployments. We have a job that runs on a schedule, and auto-approves any approvals in the most recent workflow on our main branch. 95% of the time it’s fine, but 5% of the time if someone merges shortly before the scheduled deployment, the job fails because upstream approvals do not work. Is there a plan to address this on the roadmap in a way I could follow to see updates?