laxurent
laxurent

Reputation: 75

How to create a WorkItem in Azure DevOps based off new email in Shared Inbox, but replies to emails stay within same task

I'm currently trying to set up a workflow within Microsoft Power Automate to do the following:

  1. If an email is sent to a shared email box create a new task in DevOps
  2. If someone replies back to that initial email - any responses to that thread will be tracked in the original task, and no additional tasks will be created from that chain.

Right now I'm leveraging the template that Microsoft provides called "Create a workitem in Azure DevOps when new email arrives in shared mailbox", but it creates additional tasks anytime someone replies back to the thread.

Anyone have suggestions?

Thanks,

Upvotes: 3

Views: 1738

Answers (1)

Eliot Cole
Eliot Cole

Reputation: 171

You could use a condition that checks the 'Conversation Id' then if it matches an Id from a previously sent email's Conversation Id it does nothing. If it is new, then you'll get a new task.

If you are archiving handled emails, you'll need to filter results from the archival folder.

Here it is mapped out with a SharePoint list mapping the Conversation Id from each email: enter image description here Once the details are logged, the Get Items action on the SharePoint list pulls all items. However in that pull it uses an ODATA Filter on:

conversationId eq '<Conversation Id from trigger>'

Then if the number of matches is more than the one that you've just registered in the list, that means it was a response and the flow will follow the "no" branch. However, if it is the only entry, a new work item can be made.


You can make this much more complicated, dependent on requirements, in many areas, as that why you are using Power Automate. For example you could make API (Graph) calls to get Shared Box emails, but this is simpler, and works on a free flow plan until they add a "Get Emails from a Shared Mailbox" connector.

It's not picture perfect, because it doesn't handle a changed subject line, but it does do the job required.

Upvotes: 2

Related Questions