2 Replies Latest reply on Jun 15, 2016 3:36 AM by igu06411

    Calc to email all members of a group except the analyst who assigned call to themselves

    igu06411 Apprentice

      I would like to amend one of our request processes so that if an analyst is a member of Support Group A, and they assign the request to themselves, then an email notification is sent to all the members of that group *except* them?

       

      At present, the assignment logic is as follows:

       

      IF current assignment group = GroupA

          IF current assignment user name is null

              Email notification sent to everyone in the current assignment group

          ELSE

              IF current assignment user name = current assignment creation user name i.e. analyst is assigning the request to themselves

                  Email notification sent to everyone in the current assignment group (including the analyst who assigned the request to themselves)

              ELSE

                  Email notification sent to analyst

      ELSE

          IF current assignment user name is null

              Email notification sent to everyone in the current assignment group

          ELSE

              Email notification sent to analyst 

       

      I use the following calculation in a DECISION box to determine if the user who is creating the assignment is assigning it to themselves

       

      import System

      static def GetAttributeValue(Request):

             Value = 'False'

             if Request.CurrentAssignment.User != null:

                    if Request.CurrentAssignment.User.Name == Request.CurrentAssignment.CreationUser.Name:

                           Value = 'True'

             return Value

       

      I want to change the condition in red (above) so that instead of specifying a ValueType of {Request/CurrentAssignment/Group} in the Reminder drop down, is it possible to use a Calculation to loop through all of the analysts in a group, remove the analyst who is assigning the request to themselves and only email those people?

       

      OR is it just not possible to manipulate the list of analysts in a group in case the size of the group is so huge that it causes performance problems?

        • 1. Re: Calc to email all members of a group except the analyst who assigned call to themselves
          Jenny.Lardh SupportEmployee

          Hi,

           

          This indeed sounds like a very complicated set up and I'm not sure if we could achieve this actually.

          You would need to find a logic for it to loop through all users within the group but since the Users are added through a linking (many to many) object in the database, it doesn't have the same feature as a normal collection would on an object so the logic you can use to loop through a collection in a calculation cannot be applied here.

           

          Also a reminder or assignment can only send to one group or one user. If you were to split the group up and send to "everyone but one" then you need to send out one reminder / assignment per user that you wish to send to as there is no option within the reminder / assignment to send to multiple single users.

           

          The best option here would probably be to keep your current set up, but perhaps you can make the title of the email quite unique and people can instead set up a rule in their outlook to automatically delete emails where title = "assigned to user {my name}"

          That way they won't see the email and won't be bothered by it.

           

          Kind Regards,

          Jenny