Skip to content

Adding information on how to identify job approver #9374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 4, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding code snippets for API calls
  • Loading branch information
yaningo committed May 22, 2025
commit 9e4f73244a6df8c85be904ee7213f44dbe9b68b6
18 changes: 18 additions & 0 deletions jekyll/_cci2/workflows.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,26 @@ curl --request POST \
--
. Set up your API authentication. Steps are available in the xref:api-developers-guide#add-an-api-token[API developers guide].
. You need the workflow ID so you can use the link:https://circleci.com/docs/api/v2/index.html#operation/listWorkflowJobs[get a workflow's jobs] endpoint to get the user ID.

[,shell]
----
curl --request GET \
--url https://circleci.com/api/v2/workflow/<workflow-ID>/job \
--header "Circle-Token: ${CIRCLE_TOKEN}" \
--header 'content-type: application/json' \
----

In the JSON response, take note of the value associated with the `approved_by` key.

. Then use the link:https://circleci.com/docs/api/v2/index.html#operation/getUser[user information] endpoint to get the username or email address.

[,shell]
----
curl --request GET \
--url https://circleci.com/api/v2/user/<user-ID> \
--header "Circle-Token: ${CIRCLE_TOKEN}" \
--header 'content-type: application/json' \
----

TIP: You can find detailed instructions in link:https://support.circleci.com/hc/en-us/articles/360044820493-How-to-Find-hold-Step-Approver-in-a-Workflow[this support article]

Expand Down