0

My org uses Microsoft DevOps. When a PR is assigned to me or my team, I receive and email with a subject starting with PR - and a body containing created a new pull request. As commits are pushed and comments are added, I get a bunch more emails related to it, all containing an identical subject as the original (which Outlook places into a conversation). Finally, when the commit is merged, I receive an email with completed the pull request in the body.

Once I receive this PR completed email, I manually archive the whole conversation. I would like to automate this process.

Unfortunately, there's no one rule action to move an entire conversation to a folder (that I have discovered). Is there a series of rules I could make that would do this, perhaps using categories?

  1. PR created email received
    1. Create new category named with the email's subject
    2. Assign this email to that new category
  2. Subsequent PR emails are received with a subject starting with PR -
    1. Search categories for subject name
    2. Assign this email to that category
  3. PR completed email received
    1. Search categories for subject name
    2. Assign this email to that category
    3. Archive all emails assigned to the category
    4. Delete category

I don't see an action to dynamically add categories, unfortunately, nor to search categories by name. Not to mention, if archiving a conversation isn't an available action, doing something like this which is more complicated probably isn't.

My goal in general may very well be outside the capabilities of Outlook rules, but if there is a creative/hacky solution, I'd love to hear it. If there isn't, and this is the purview of vbscript (which might just be easiest in the first place), do any of you know if such a script already exists, so I don't reinvent the wheel?

1 Answer 1

1

No. The outlook rule system only works on individual messages. When a mail arrives, the rule is immediately applied to it, and it is not possible to create a rule that affect other messages.

VBA might be able to do this, but its very complicated and I honestly don't have enough experience with VBA in Outlook to even give you pointers. I once tried macros in outlook as I can do them in excel and word, but failed miserably.

The best alternative I can give you is to setup custom actions. You still have to select the mails, but you can then press the custom action to perform that task.

3
  • Sad times. Currently I just select the conversation and press ctrl+shift+1 and it archives it for me. I just like to automate everything.
    – dx_over_dt
    Jul 30, 2020 at 16:47
  • I think you already have the most optimal way of doing it.
    – LPChip
    Jul 30, 2020 at 16:47
  • Yes, as LPChip mentioned, you may need a VBA method to make it run automatically.
    – Jeff Yang7
    Jul 31, 2020 at 1:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.