Pages

Tuesday, December 15, 2015

QC Workflow script to send mail automatically whenever the Test case status is changed

Sub TestPlan_CustomNotification()
On Error Resume Next
Set Tdc = TDConnection
Set TestFact = Tdc.TestFactory
Set TestFilter = TestFact.Filter
TestID = Test_Fields("TS_TEST_ID").value
TestName = Test_Fields("TS_NAME").Value
strChangedBy = User.FullName

'Add filter
TestFilter.Filter("TS_TEST_ID") = TestID
Set TestList = TestFilter.NewList
Set MyTest = TestList.Item(1)

'Add the recipient
strTo = "Mail Id here"
'strComment =  TestName & " Updated by : " & strChangedBy
'Send a mail
MyTest.Mail strTo,,2,TestName, strComment

'Release memory
Set MyTest = Nothing
Set TestList = Nothing
Set TestFilter = Nothing
Set TestFact = Nothing
Set Tdc = Nothing
On Error Goto 0
End Sub

No comments:

Post a Comment