You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding information on how to identify job approver (#9374)
* Adding content on how to identify job approver
* Adding code snippets for API calls
* Adding instructions on how to get th workflow ID
* Adding short intro
* Updating obsolete xref
Copy file name to clipboardExpand all lines: jekyll/_cci2/workflows.adoc
+74Lines changed: 74 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -277,6 +277,80 @@ curl --request POST \
277
277
--header "Circle-Token: ${CIRCLE_TOKEN}" \
278
278
--header 'content-type: application/json' \
279
279
----
280
+
--
281
+
282
+
283
+
=== Identify the user who approved a job
284
+
285
+
To identify the user who approved a job, you can use the CircleCI web app or the API.
286
+
287
+
[.tab.identify.CircleCI_web_app]
288
+
--
289
+
* If the user signed up via GitHub, the (non-clickable) avatar of the GitHub user appears next to the approval job. Hovering over that avatar brings up a tooltip with the user's name as specified in their GitHub/Bitbucket account settings.
290
+
291
+
* If the user signed up via email, the anonymous avatar appears next to the approval job; hovering over that avatar brings up a tooltip with the user's email address.
292
+
--
293
+
294
+
[.tab.identify.API]
295
+
--
296
+
. Set up your API authentication. Steps are available in the xref:api-developers-guide#add-an-api-token[API developers guide].
297
+
. 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. You can get the workflow ID using xref:variables#[pipeline values or environment variables], or by xref:outbound-webhooks#[receiving webhooks] or link:https://circleci.com/docs/api/v2/index.html#tag/Pipeline/operation/listWorkflowsByPipelineId[polling the API]
** If the user who approved the job signed up via GitHub or Bitbucket, the response from the user information endpoint will have the following format:
329
+
+
330
+
[,json]
331
+
----
332
+
{
333
+
"name" : "User’s name as specified in their VCS account settings",
334
+
"login" : "VCS username",
335
+
"id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
336
+
}
337
+
----
338
+
339
+
** If the user who approved the job signed up via email, the response from the user information endpoint will have the following format:
340
+
+
341
+
[,json]
342
+
----
343
+
{
344
+
"name" : "Email address",
345
+
"login" : "Email address",
346
+
"id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
347
+
}
348
+
----
349
+
350
+
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]
0 commit comments