Automation Testing, Manual Testing, QTP/UFT 11 , QC/ALM 11 ,SAP TAO, Unix, Selenium, Oracle SQL, Shell Scripting and For Online Trinings to contact me : Cell:+91-8897972059 , Email Id : quicktestprotech@gmail.com
Showing posts with label How to mail users according user group using workflow script.. Show all posts
Showing posts with label How to mail users according user group using workflow script.. Show all posts

Wednesday, July 9, 2014

How to mail users according user group using workflow script.

How to mail users according user group using workflow script.


Here is a sample code to mail users from “TDAdmin” group

Dim uCnt, header, body, custUsers, usr, UList
set td = TDConnection
Set custUsers = td.Customization.Users
Set UList = custUsers.Users
header= "Defect ID:" & Bug_Fields("BG_BUG_ID").Value & " - Changed to priority : " & Bug_Fields("BG_PRIORITY").Value
body= "Defect Summary : " & Bug_Fields("BG_SUMMARY").Value
msgbox UList.Count
For Each usr In UList
    uCnt = uCnt + 1
    With usr
        if usr.InGroup("TDAdmin") then
           msgbox "Mailing " & .name & ", " & .Email
           td.SendMail .Email ,"admin","Summary","body",NULL,"HTML"
        end if
    End With
Next

Loading...