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

Re: Auto email on addition of a new test case to the test plan

$
0
0

Thanks for the reply.  

 

Since the users are using Sprinter to enter their test case they cannot use QC GUI's email feature to send the email once they enter the test case.  So following is the code I have for sending the email to the automation engineer once the user enters a test case.  

 

I am not sure whether this should be in the Test_new sub or in the Test_AfterPost sub.  Since I don't want the email to be send to the whole TDAdmin group I am setting it to specific email addresses.

 


Sub Test_AfterPost
On Error Resume Next
Dim strTo, strCc, strSubject, strComment

' Right now the address is set to individual addresses since we don't need to
'send the email to the whole group
'
strTo = "a@c.net"
strCc = "b@c.net"
strSubject = "A new test case is added in the domain " & TDConnection.DomainName


strComment = "The user " & User.FullName & " has added a new test case named " &_
Test_Fields("TS_NAME").Value & " in the domain " & TDConnection.DomainName &_
" for project " &TDConnection.ProjectName & " in the module " &_
TDConnection.TestFolder_Fields.Field("AL_DESCRIPTION").Value

 

iObjName = Test_Fields("TS_NAME").Value


SendTest iObjName, strTo, StrCc, StrSubject, StrComment
PrintError "Test_AfterPost"
On Error GoTo 0
End Sub


Sub SendTest (iObjName, strTo, strCc, strSubject, strComment)
On Error Resume Next
Dim objTestFactory, objTest
Set objTestFactory = TDConnection. TestFactory
Set objTest = objTestFactory.Item(iObjectId)
objTest.Mail strTo, strCc, 2, strSubject, strComment
Set objTest = Nothing
Set objTestFactory = Nothing
PrintError "SendTest"
On Error GoTo 0

End Sub

 

 

I tried adding a new test case and I am not getting any email.  I am not getting any error either.  The mail server host, protocol, port etc are all set.  Am I missing anything in this code or this should  be in some other sub?  

Thanks.


Viewing all articles
Browse latest Browse all 14708

Trending Articles



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