Absent Member.
Absent Member.
5618 views

Automail from Test Lab/Test Set in Quality Center 10.0

Is there a way to set up a notification or automail to be sent to a group when a Test is changed to the status of failed /failed in Test Lab/test set modules.

Currently quality center 10.00 supporting only modules Defect to send auto mail.
0 Likes
47 Replies
Absent Member.
Absent Member.

Hi Jan Czajkowski,

Great Thanks

It's works fine
0 Likes
Absent Member.
Absent Member.

Hi Jan,

Thanks a lot for your comments

The following your scripts working fine.Is it possible to include test case name or test case id.

Sub TestSetTests_FieldChange(FieldName)
If FieldName = "TC_STATUS" Then
TDConnection.SendMail youremail@xyz.com, "", "Test email", "Testing"
End If
End Sub
0 Likes
Fleet Admiral
Fleet Admiral

TestSetTest_Fields.Field("TC_TEST_ID").Value

gives you the Test ID.

testID = TestSetTest_Fields.Field("TC_TEST_ID").Value
TDConnection.TestFactory.Item(testID).Field("TS_NAME")

gives you the Test name.
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
Absent Member.
Absent Member.

Thanks for your comments

Is it possible to send automail along with test scripts and attachment from testset when assigning the test cases to tester.

0 Likes
Fleet Admiral
Fleet Admiral

Technically it is possible to do that using SendMail, but I am not sure it is the best way of assigning testing tasks.
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
Absent Member.
Absent Member.

Hi Jan,

The following mail sending mail only to Responsible tester not to Groups (PM).

Please guide me.

if TestSetTest_Fields.Field("TC_STATUS").Value="Completed" then
strComment = "The user " & User.FullName
testID = TestSetTest_Fields.Field("TC_TEST_ID").Value
testNAME =TDConnection.TestFactory.Item(testID).Field("TS_NAME")
Subject = "Test Case Status Change Notification " & _
" for project " & TDConnection.ProjectName & _
" in domain " & TDConnection.DomainName
strDesc = "The Test Case " & testNAME & " Completed"
TDConnection.SendMail TestSetTest_Fields.Field("TC_TESTER_NAME").Value, _
"[Test Manager]",Subject, strDesc
End if
0 Likes
Fleet Admiral
Fleet Admiral

You need to concatenate both address parts. And you need an empty parameter for the sender. Try this:

TDConnection.SendMail TestSetTest_Fields.Field("TC_TESTER_NAME").Value & ";[Test Manager]", "", Subject, strDesc
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
Absent Member.
Absent Member.

Great Thanks Jan.
It is working fine now
0 Likes
Absent Member.
Absent Member.

Hi Jan,

I need one more help.

I have installed QC 10.0 and I have one issue when I am sending automail from Test Plan module.

When the users change the status in test plan, the test manager is getting original test plan status thru autoemail instead of new test status.

E.g.

The user changed the status from ready for review to ready for test. Here the Test Manager getting the automail showing that the status with â Ready for reviewâ (i.e. previous status) instead of â Ready for Testâ (Current Status)

Note: I have enabled the version control for this project.


Please help me to solve this.

0 Likes
Fleet Admiral
Fleet Admiral

Try moving the code where you send the email to Test_AfterPost.
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
Absent Member.
Absent Member.

Hi Jan,

Thanks for your response... I moved teh code to test_AfterPost()... No mails received.

code is here:-
Sub Test_AfterPost(FieldName)

Dim strSubject, strComment
If FieldName = "TS_STATUS" Then
strSubject = "Test Case Status Change Notification" & _
" for project " & TDConnection.ProjectName & _
" in domain " & TDConnection.DomainName
strComment = "The user " & User.FullName & _
" changed the status of the test " & _
Test_Fields("TS_NAME").Value & _
" to " & Test_Fields("TS_ STATUS").Value

if Fieldname ="TS_STATUS" and _
Test_Fields("TS_STATUS").Value = "Ready for Review" then
MsgBox "Current status is Ready for Review"
SendTest Test_Fields("TS_TEST_ID").Value, _
Test_Fields("TS_RESPONSIBLE").Value, "[Test Manager]", _
strSubject, StrComment
End if
End if
'On Error GoTo 0
End Sub


Sub SendTest (iObjectId, strTo, strCc, strSubject, strComment)
'On Error Resume Next
Dim objBugFactory, objBug
Set objBugFactory = TDConnection.TestFactory
Set objBug = objBugFactory.Item(iObjectId)
objBug.Mail strTo, strCc, 2, strSubject, strComment
Set objBug = Nothing
Set objBugFactory = Nothing
'PrintError "SendStatus"

End Sub


Please help.
0 Likes
Fleet Admiral
Fleet Admiral

AfterPost does not take any parameter - no FieldName.

You can try using IsModified to check if the field was changed before posting.
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.