First flow triggers second flow then update item action takes place

29 Views Asked by At

I have two separate automated workflows in place.

  1. 1st flow The first workflow is initiated manually by a user. It retrieves an item from a SharePoint list, creates a corresponding work item in Azure DevOps, retrieves the generated AzureDevopsID, updates the SharePoint item with this ID, retrieves attachments, and attaches them to the created work item in Azure DevOps.

  2. 2nd flow The second workflow is triggered automatically whenever an item or file is modified in the SharePoint list. It retrieves the modified item, updates the corresponding work item in Azure DevOps, and attaches any updated attachments to it.

However, I'm encountering an issue where the first workflow's action of updating the SharePoint item with the AzureDevopsID triggers the second workflow, which I want to avoid. I need to prevent the first workflow from inadvertently triggering the second one when updating the SharePoint item with the AzureDevopsID. How can I accomplish this?

1

There are 1 best solutions below

0
Miao Tian-MSFT On

Based on your description, you can consider the following idea:

  1. First, use a custom project process in Azure DevOps, so that you can add a field named updated_by_auto_workflow to your work item. You can set the field is false by default. Please refer Add a custom field to a work item type (Inheritance process) for the detailed steps.

  2. In the first workflow, we need to set the value of field updated_by_auto_workflow to true in the Create work item step.

  3. The second workflow is automatically triggered when the first workflow's action of updating the SharePoint item with the AzureDevopsID. You can add a step to get the workitem details including the value of field updated_by_auto_workflow. If the value is true, you can skip the rest steps of the second workflow. If the value is false, you can do the rest steps of the second workflow.