Extract Devops Work Item Drop Down Value Using Power Automate

Introduction

Azure DevOps board is used to create a task or work item with a pre-defined or custom work item template. It can consist of multiple different types of fields like Text, Multi Text, Drop Down, Identity (People Picker), and Date Time. If, as a developer, I need to extract all schema-defined drop-down values and need to sync with another system like the SharePoint Online List choice column.

I have divided this article into two parts,

  1. Extraction of Work Item Drop Down values using Power Automation
  2. Sync the extracted drop-down values with the SharePoint Online List Choice column.

Let's begin here with the creation of a work item and extraction using power automate.

  • Login to https://dev.azure.com with your valid organization credentials.
  • Select the respective organization and project. (In my case, m365x6151710 is my organization, and Resource is a project name).
  • Navigate to Borad from the left-hand side menu and click New Work Item.
  • Select the work item as Resource (custom work item type with defined i.e. multiple dummy columns).
    Extract Devops Work Item Drop Down field value
  • Resource Work Item type has the below layout, and the User can submit the detail as provided.
  • Technical Skill i.e. drop-down field, has multiple values which need to extract.

Extract Devops Work Item Drop Down field value

Power Auotmate Steps

  • Create a Recurrence flow,
  • Add Azure DevOps action i.e. "Send an HTTP request to Azure DevOps".
    Extract Devops Work Item Drop Down field value
  • Relative URI:
    https://dev.azure.com/m365x6151710/Resource/_apis/wit/workitemtypes/Resource/fields?$expand=allowedValues&api-version=5.1
    Organization Name m365x6151710
    Project Name Resource
    Work Item Template Name Resource
  • Add Variable of type Array and name as Technical Skill
  • Add action "Apply to each" with an output of "Send an HTTP request to Azure DevOps" -> This will return all Azure DevOps work item fields 
  • Add a Condition to restrict the specific column i.e. "Custom.TechnicalSKill". (All Custom created columns should be treated as prefixes with Custom.)
  • Once the Condition is satisfied, select the allowed values and set it back to the variable.
    Extract Devops Work Item Drop Down field value

This is how the entire power automate looks like.

Extract Devops Work Item Drop Down field value

Let's execute the power automate to get the output.

Extract Devops Work Item Drop Down field value

Now, these extracted values can be synced with another system like SharePoint Online List, so both systems i.e. Azure DevOps and SharePoint Online List choice values, should be in sync without manually updating.

Hope you have learned something useful and stay tuned with the next part of the article i.e. Sync these values with SharePoint Online List Choice columns as schema values.


Similar Articles