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.
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.
- Select the Service hooks from the Left-hand side pane.
- Select "+ Create Subscription," and Pop Up will appear with Title "New Service Hooks Subscription".
- Select the WebHooks
- Click Next to Proceed
Step 2. Update the Trigger action, Project Name, and Column Name
- Select the Work Item Updated under Trigger on this type of event dropdown.
- Select Project Name under Filter sub-section area path.
- Select Resource as Work item Type (It can be different as per the defined template name).
- Select the field or column name responsible for triggering the Power Automate based on trigger defined action.
Step 3. The next Wizard option ends with the Power Automate Invoke trigger action url.
- 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.
- Take the HTTP POST URL from the Power Automation trigger action and Paste it into the URL under Settings.
- Click Finish to proceed and close the wizard.
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.
Execution Steps
Let's Change the value into Azure DevOps Work Item and validate the scenario.
Output
Execution Happened only once, which saved the number of runs & consumption.
Item also created into SharePoint Online List.
This is the best practice to follow defined standards and effectively utilize product-related services. Hope you have learned something useful here.