3 Replies Latest reply on Oct 15, 2018 9:03 AM by Aart_Albint

    Approval Vote Tracking via Email

    BMarth1 Rookie

      We currently allow approvals via email. We have setup keywords such as "approved" and "denied" that update the status of the change request to approved/denied. The one issue we have is that we cannot see who voted for the approval. The only way I can see is to look at the email module for incoming emails. If we have users approver or deny in self service they correctly show who voted. Looking to see if anyone has encountered this issue and how they got around it.

        • 1. Re: Approval Vote Tracking via Email
          AlasdairRobertson ITSMMVPGroup

          If it is needed to link the actual user you could pull the email address form the incoming email pass it to the to the approval vote tracking object then run a search and link or parse out the user name from an employee record to get the look up of the user.

           

          You might if using an XSLT parser be able to do the lookup as part of the transform. 

          1 of 1 people found this helpful
          • 2. Re: Approval Vote Tracking via Email
            Terry Douglas Apprentice

            Hi BMarth1,

             

            At the core of the issue is the following Editing Rule on FRS_ApprovalVoteTracking:

             

            $(if Status != "Pending" then CurrentLoginId() else null)

             

             

            When the vote is approved/denied, the current user's login ID is put in the Voted By field. When the vote is made via email, the current user is InternalServices. This is what prevents you from seeing who voted on the Approval Vote Tracking records.

             

            One solution could be to adjust this rule to set Voted By to the vote owner's ID if CurrentLoginID = InternalServices. If your Employees use their email address as their LoginID, this could be as simple as changing it to:

             

            $(if Status != "Pending"

              then if CurrentLoginId() == "InternalServices"

                   then OwnerEmail

                   else CurrentLoginId()

              else null)

             

            If Email != LoginID then you would need to build something a bit more complex, but it should be doable (e.g. adding an OwnerLoginID field to FRS_ApprovalVoteTracking, populating it at vote creation and using that instead of OwnerEmail in the above expression).

            1 of 1 people found this helpful
            • 3. Re: Approval Vote Tracking via Email
              Aart_Albint Rookie

              I ran into this, and the solution for me is a combination of both previous answers, knowing that neither is complete.

               

              I use an XSLT to parse incoming mails into various objects. I had to make these changes to Approval_Update.xsl

              Add the email address of the sender to a variable:

                <xsl:variable name="emailFrom">

                <!-- for each RelatedBusinessObject -->

                  <xsl:for-each select="BusinessObjectList/BusinessObject/RelatedBusinessObjectList/RelatedBusinessObject/BusinessObject">

                <xsl:choose>

                  <xsl:when test="@Name = 'Employee'">

                  <xsl:for-each select="./FieldList/Field">

                    <xsl:choose>

                  <xsl:when test="@Name = 'PrimaryEmail'">

                    <xsl:value-of select="."/>

                  </xsl:when>

                    </xsl:choose>

                  </xsl:for-each>

                  </xsl:when>

                </xsl:choose>

                  </xsl:for-each>

                </xsl:variable>

               

               

              Put that variable into a custom field on the approval tracking object.

                        <xsl:element name="Field">

                        <xsl:attribute name="Name"><xsl:text>AARTFIELD_ApprovedBy</xsl:text></xsl:attribute>

                        <xsl:value-of select="$emailFrom"/>

                        </xsl:element>

               

              Modify the FRS_ApprovalVoteTracking object:

              Add the custom field (obviously).

              Modify two business rules:

              Changed the Edit rule for Status to update VotedBy from it's default to

              $(if Isnull(VotedBy)

                then if Status != "Pending"

                     then if Isnull(AARTFIELD_ApprovedBy) then CurrentLoginId() else AARTFIELD_ApprovedBy

                     else null

                else VotedBy)

               

              then go to the BeforeSave rule for VotedBy and do the same thing!

               

              As far as I've tested, this works. Note that:

              - anyone with the ability to send in emails can vote if they know the vote's tracking ID (the 5 digit number in the subject line). it doesn't bother to verify the vote is from who it should be, for some reason. We're going with the assumption this won't be an issue because a. nobody bt the approver gets an email telling them to vote and b. we see who voted if we have to go back and check how come something got approved that shouldn't be. From an audit perspective, we're covered.

              - technically I'm nabbing the email address not from the sent email but from the Employee record it is already associated with when it gets handed to the XSLT parser. This would mean that an invalid sender would also show an invalid email address. I haven't worked out how to grab the actual address from the email but since we (will soon?) disallow externals emailing into our service manager mailbox, this isn't a problem in my case.