Invoke PowerAutomate on the Change Specific Field/Column Value of DevOps

Problem Statement

Azure DevOps also have a premium connector with power automate. It consists of triggers and multiple actions on item add, updates, delete, etc. On update of any item, we usually use the Item update action to capture the details. But the downside of this approach, Power Automate will invoke every time whenever changes happen to a DevOps work item, whether it's required to capture or not. It's unnecessary to increase the number of counts, which is limited per user account, and increase the flow history.

Solution Approach

Let's invoke Power Automate to change the "Sync To SharePoint Online" Toggle button only.

Specific field/Column value of DevOps

This sequence of steps helps to execute the power automate on change of a specific column instead of item work item,

Step 1. Select the Project Setting of the Project.

  1. Select the Service hooks from the Left-hand side pane.
  2. Select "+ Create Subscription," and Pop Up will appear with Title "New Service Hooks Subscription".
  3. Select the WebHooks
  4. Click Next to Proceed
    Specific field/Column value of DevOps

Step 2. Update the Trigger action, Project Name, and Column Name 

  1. Select the Work Item Updated under Trigger on this type of event dropdown.
  2. Select Project Name under Filter sub-section area path.
  3. Select Resource as Work item Type (It can be different as per the defined template name).
  4. Select the field or column name responsible for triggering the Power Automate based on trigger defined action.
    Specific field/Column value of DevOps

Step 3. The next Wizard option ends with the Power Automate Invoke trigger action url.

  1. Navigate to Power Automate and create new top new trigger action as "When an HTTP request is received" and add parse json as a response action next to that.
  2. Take the HTTP POST URL from the Power Automation trigger action and Paste it into the URL under Settings.
  3. Click Finish to proceed and close the wizard.
    Specific field/Column value of DevOps

Once the wizard is added, You can see the WebHook is created under the service hook and ready to execute item updates on specific column values. 

Specific field/Column value of DevOps

Execution Steps

Let's Change the value into Azure DevOps Work Item and validate the scenario.

Specific field/Column value of DevOps

Output 

Execution Happened only once, which saved the number of runs & consumption. 

Specific field/Column value of DevOps

Item also created into SharePoint Online List.

Specific field/Column value of DevOps

This is the best practice to follow defined standards and effectively utilize product-related services. Hope you have learned something useful here.


Similar Articles