Skip to content

Add ai_workflow scope to issue api

Jeff Park requested to merge jpark/main/add-ai-workflow-scope-issues-api into master

What does this MR do and why?

This change adds the ai_workflow scope to the issues MR so that Duo Workflow can interface with it

related: #497837, #498082

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. In rails console enable the Duo Workflow feature flag

    Feature.enable(:duo_workflow)
  2. Invoke the class to generate an oauth token with the ai_workflow scope

    Ai::DuoWorkflows::CreateOauthAccessTokenService.new(current_user: User.first).execute
  3. This token can be used to authenticate various endpoints. For example:

     curl --header "Authorization: Bearer $TOKEN_FROM_LAST_STEP" --url "https://gdk.test/api/v4/issues"

Merge request reports

Loading