Hello All,
I am in need of assistance with building an xsl file for an email listener I am configuring. I am very close (with help from a template) but stumped on one section. I am needing the listener to create the service request based on the name of a person from which the email defines by "Custid="user_name". Currently the xsl file I am working with creates the service request from who the email is sent.
An example of what the file is current doing would be: I send an email from the account jdoe@example.gov. The ticket will be created under the name John Doe because John Doe has a user account in our system.
If I was to send an email from sharepoint@example.gov, no tickets is created because there is no associated account for SharePoint in our system. The email that the requests will be coming from will be like this example though, so the ticket needs to be created based on a parameter in the email. An example of the incoming email for reference would be:
Subject:SharePoint ADM Request
Body:
ADM Request details:Request ID:310
Applicant: Doe, John
Manager: Doe, Jane
Reason For Requesting: Maintenance, software installation, and group support for shared linux machines used to run models and store data.
Type Of System: Server
Name Of System:
User Account:adm-jdoe
Expiration Date: 1/2/2019 12:00:00 AM
Custid=jdoe
Category=Service RequestService_Area=Account, Identity, and Access Management
CallType=Account Setup
AsgnGrp=Tier 1
SubGroup=Example
From this email, I need the xsl file to pick out Custid=jdoe, parse that information, and then create the service request in the name of John Doe. "jdoe" is John Doe's user name in our system for clarification.
I have attached the Main xslt file (main_xslt.txt) and the Service Request xsl file (SR_import.xsl) I am working with to try and accomplish this. Everything else in these files is working to my expectation, we are just focusing on the ticket creation based on "Custid" for this post.
My best guess is modifications to the section below from the SR_import.xsl file will need to be made, but I am not sure:
<!-- find the profile link recid of the email sender, they will be the service requestor/customer-->
<xsl:variable name="ProfileRecId">
<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 = 'RecId'">
<xsl:value-of select="."/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:variable>
Please let me know if any of this needs any further explanation.
Thank you very much to anyone assisting!