10 Replies Latest reply on May 17, 2018 3:17 PM by wynnb

    How to send email all task owners in a Milestone

    wynnb Apprentice

      I'm looking for a way to send an email to all owners of tasks in a Release Milestone. I'm thinking a quick action would be best, but not sure how to automatically add all task owners (assignees) to the To: field of the email.

       

      Anyone know how to write that function?

        • 1. Re: How to send email all task owners in a Milestone
          AlasdairRobertson ITSMMVPGroup

          Hi Bryan

           

          I would Childfold through the milestones and the through the tasks on each milestone to get the task owners, a bit fiddly but that is the approach.  I will try to knock up the expression this evening for you.

          • 2. Re: How to send email all task owners in a Milestone
            wynnb Apprentice

            That would be great - thank you!

            • 3. Re: How to send email all task owners in a Milestone
              AlasdairRobertson ITSMMVPGroup

              SO here is the expression:

               

              $(Replace(ChildFold("ReleaseProject#",

                  RecId,

                  "ReleaseMilestone#.ReleaseAssociatesMilestone",

                  $(if ChildFold("ReleaseMilestone#",

                        RecId,

                        "Task#.ReleaseMilestoneContainsTask",

                        $(if EvalField("Employee#",  Owner_Valid,  "PrimaryEmail") in

                                (null,  "")

                            then ""

                            else EvalField("Employee#",  Owner_Valid,  "PrimaryEmail") + ";"),

                        "+") ==

                        0

                      then ""

                      else ChildFold("ReleaseMilestone#",

                          RecId,

                          "Task#.ReleaseMilestoneContainsTask",

                          $(if EvalField("Employee#",  Owner_Valid,  "PrimaryEmail") in

                                  (null,  "")

                              then ""

                              else EvalField("Employee#",  Owner_Valid,  "PrimaryEmail") +

                                    ";"),

                          "+")),

                  "+"),

                ",",

                ""))

               

              You cannot use it directly in a send email action to I would add a new field to the release object for group email (text [max]) call a composite action which builds the email address using the above expression and then in your send email action call your new mail field.

              1 of 1 people found this helpful
              • 4. Re: How to send email all task owners in a Milestone
                wynnb Apprentice

                Amazing.

                 

                Thanks Alasdair, I’ll give it a go!

                • 5. Re: How to send email all task owners in a Milestone
                  wynnb Apprentice

                  I set this up in STG, and it works just fine and would be perfect for automated emails, so thank you Alasdair.

                   

                  However… my users are asking for a way to send a message to the task assignees in a Milestone, using the Activity History tab (New Email action).  I’d really like to have that list of addresses available as a group in the “Contacts related to ReleaseMilestone#” tab of the address book when using that New Email action.

                   

                  For that, wouldn’t I need a relationship between the Milestone and Employee objects? In the Release object, I see ReleaseAssociatesEmployee, and EmployeeAssocaitedReleaseAsRRB (not my spelling – that’s an OOTB relationship…), but nothing like that in Milestone. Seems like I’d need the relationship and a way to populate the group for any given Milestone.

                  • 6. Re: How to send email all task owners in a Milestone
                    AlasdairRobertson ITSMMVPGroup

                    Hi Bryan

                     

                    I have got it working but run out of time to write it up for you I will do it tomorrow and post.

                     

                    Alasdair

                    • 7. Re: How to send email all task owners in a Milestone
                      AlasdairRobertson ITSMMVPGroup

                      Sorry a day late I was travelling.  Here are the steps for the Milestone (ReleaseProject#):

                       

                      1. Add a new field to ReleaseMilstone OwnerEmailAddress (Text unicode [max])

                      2. Add a new quick action to The milestone (ReleaseProject#) in this case a poorly named AR - Test but this will update our new Owneremailaddress field

                       

                      $(Replace(ChildFold("ReleaseMilestone#",     RecId,     "Task#.ReleaseMilestoneContainsTask",     $(if EmailAddress in (null,  "") then "" else EmailAddress + ";"),     "+"),   ",",   ""))

                       

                       

                       

                      3. Add a new Triggered action to Tasks#Assignment on Insert or Update and ParentLink_Category == ReleaseMilestone

                       

                      4. Run for Child "ReleaseMilestoneContainsTask"

                       

                      5. On the ReleaseMilestone (ReleaseProject#) Add Use the Expression below in a send email quick action from the Release object:

                       

                      • 8. Re: How to send email all task owners in a Milestone
                        wynnb Apprentice

                        This is great Alasdair, I'll give it a try today.

                        BTW - when you're a goldmine, you never need to apologize.  ;-)

                         

                        I truly appreciate your help.

                        • 9. Re: How to send email all task owners in a Milestone
                          AlasdairRobertson ITSMMVPGroup

                          As someone just reminded me of this, did you get this working Bryan?

                          • 10. Re: How to send email all task owners in a Milestone
                            wynnb Apprentice

                            Thanks for the reminder-- I think I started this but had to put it aside for other priorities. I'll try it again as soon as I can and reply here.

                             

                            Thanks again Alastair!