Quantcast
Channel: All Quality Center / ALM Practitioners Forum posts
Viewing all articles
Browse latest Browse all 14708

Re: How to customize the fields generated in the auto email - Please Help

$
0
0

you can use somethng like below. Write it as a separate sub & then call wherever you require (like when a defect is submited, you can call this in bug_afterpost)

 

___________________________________________________________

 

Sub EmailDefect
On Error Resume Next
    'delcare td connection object
     dim tdc ' TDConnection
    'declared strings used to compose email
     dim header 'as string
     dim body 'as string
     dim strUser 'as string
    'initilalize td connection object
     set tdc = TDConnection

    'declared strings used for email of defects details
     dim strsubject 'as string
     dim strServer 'as string
     dim strDomain 'as string
     dim strProject 'as string
     dim strDefectID 'as string
     dim strDefectStatus 'as string
     dim strDefectSummary 'as string
     dim strhyperlink 'as string
     dim strDefectDesc 'as string

    'setting all the variable calls
     strServer = "your QC URL upto qcbin"
     strDomain = TDConnection.DomainName
     strProject = TDConnection.ProjectName
     strsubject = strDomain & "." & strProject
     strUser = Bug_Fields("BG_RESPONSIBLE").Value
     strDefectID = Bug_Fields("BG_BUG_ID").Value
     strDefectStatus = Bug_Fields("BG_USER_05").Value
     strDefectSummary = Bug_Fields("BG_SUMMARY").Value
     'strRelease = Bug_Fields("BG_USER_11").Value
     strPhase = Bug_Fields("BG_USER_02").Value
     strSeverity = Bug_Fields("BG_USER_06").Value
     strDefectDesc = Bug_Fields("BG_DESCRIPTION").Value
     strhyperlink = "<a href=" & chr(34) &"testdirector:" & strServer & "," & strDomain & "," & strProject & "," & strUser & ";2:" & strDefectID & chr(34) & ">Defect #" & strDefectID & "</a>"

     'contsruct email header and body
     header=  strsubject & " - " & "Status of Defect #" & strDefectID & " has been updated to " & strDefectStatus
     body ="<table width="& chr(34) &"500" & chr(34) &"border=" & chr(34) &"1" & chr(34) &"cellpadding=" & chr(34) &"3" & chr(34) &" cellspacing=" & chr(34) &"0" & chr(34) &">" &_
      "<tr >" &_
       "<td width=" &chr(34)&"20%"&chr(34)&"colspan="&chr(34)&"2"&chr(34)&" bgColor="&chr(34)&"#330066"&chr(34)&">" &_
       "<font color="&chr(34)&"fef9e9"&chr(34)&"><b>Brief Defect Details</b> </td></font>" &_
      "</tr>" &_
      "<tr>" &_
       "<td width=" &chr(34)&"20%"&chr(34)&" bgColor="&chr(34)&"#ccbbaa"&chr(34)&"> <b>Defect ID</b> </td>" &_
       "<td bgColor="&chr(34)&"#ccccff"&chr(34)&">" &_
       "<font color="&chr(34)&"000066"&chr(34)&">" & strhyperlink  & "</td></font>" &_
      "</tr>" &_
      "<tr>" &_
       "<td width=" &chr(34)&"20%"&chr(34)&" bgColor="&chr(34)&"#ccbbaa"&chr(34)&"> <b>Phase Type </b> </td>" &_
       "<td>" & strPhase & "</td>" &_
      "</tr>" &_
      "<tr>" &_
       "<td width=" &chr(34)&"20%"&chr(34)&" bgColor="&chr(34)&"#ccbbaa"&chr(34)&"> <b>Defect Severity Level</b> </td>" &_
       "<td>" & strSeverity & "</td>" &_
      "</tr>" &_
      "<tr>" &_
       "<td width=" &chr(34)&"20%"&chr(34)&" bgColor="&chr(34)&"#ccbbaa"&chr(34)&"> <b>Defect Summary</b> </td>" &_
       "<td>" & strDefectSummary & "</td>" &_
      "</tr>" &_
      "<tr>" &_
       "<td width=" &chr(34)&"20%"&chr(34)&" bgColor="&chr(34)&"#ccbbaa"&chr(34)&"> <b>Defect Description</b> </td>" &_
       "<td>" & strDefectDesc & "</td>" &_
      "</tr>" &_
     "</table>"
     'parameters of TDConnection.SendMail are the following:
     'SendMail(<To>, <From>, <Subject (Optional)>, <Message (Optional)>, <AttachArray (Optional)>,<Format(HTML or Text, Optional)>)
     tdc.SendMail strUser,admin,header,body,NULL,"HTML"
On Error GoTo 0
End Sub


Viewing all articles
Browse latest Browse all 14708

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>