cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
adityabajaj
Microsoft
Microsoft

Update existing Azure DevOps work item using Microsoft Flow when someone responds to an email

I am able to create a work item using Microsoft Flow in Azure DevOps although I have questions on that as well. But first:

- How do I update an existing work item if someone replies to the email that they previously sent to create the work item? I dont know what is the best way to find whether an item already exists but the logic I have on mind is checking whether the subject line contains "RE:" and then based on that either create a new work item or update existing. With updating existing, I am having issues in finding the existing work item because it asks me ID but all I have is subject line to look up the ID and use that ID.

 

Also, for the email notifications sent from DevOps, how do I modify the "from" email so that it always gets sent to the email that I am using to trigger Microsoft Flow?

 

If there is a better option to create/update work items using emails, I am open to that as well.

 

Thanks,

Aditya

4 REPLIES 4
v-yamao-msft
Community Support
Community Support

HI @adityabajaj ,

 

Do you want to check if a record already exists in Azure DevOps to either update an existing work item or create a new one?

 

I don’t have Azure DevOps to test this issue, so I have created a flow based on SharePoint list for your reference.

 

In the following scenario, I am going to check if the incoming email’s subject exists in the list, if yes, update the Date column with email received time, if no, create a new one.

 

In the flow, I initialized an Array variable named as SubjectTest.

 

Under action Get items, add Apply to each, then the action Append to array variable within the loop. Set its value as dynamic content Title.

 

Add a Condition to check if the variable SubjectTest contains Subject.

 

Under if yes branch, add another Condition 2 to check if the email subject is equal to Title. If yes, update item.

 

Under if no branch, add action Create item to create a new item.

 

Images for your reference.

1.PNG2.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yamao-msft
Community Support
Community Support

Hi @adityabajaj ,

 

Have you made a test on your side?

 

Could it be a reference for you?

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 
dbojadjiev
New Member

Hi,

 

I am trying to get to work a workflow of nearly the same topic. When an email is received for the first time in one day with specific words like "Alarm" in the subject, the flow should check whether a work item with a title of that particular date + the email's subject exist in the list of work items. In case there are no items, create one. Creating a work item with that name is solved by adding "formatDateTime(utcNow(),'yyyy-MM-dd') + subject" in the title. In case an item already exists, update the same with the email's "Body".

 

Could someone please provide feedback to the same topic for outlook, instead of sharepoint, as i consider i could reuse the same solution with some modifications.

 

Kind Regards

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,477)