Send an Email when User field (Requirements Module) ”Assigned To” is set to Particular User
Question ID: 107879
1
0

I need to send an automatic email whenever the Assigned To field in the Requirements module is set to the particular user. I would like to send with the change of the Status field as Ready for Review…
I have added Assigned To User Field under Project Entities-> Requirements Module, the field name is "RQ_USER_01", Type as user list.
I have also modified the System field label Reviewed to Status and added List Items as In Process, Ready for Review and Approved. Basically, when the Requirement is Ready for Review, send an email to the Assigned user with details and attachment if there are any.

Marked as spam
Posted by (Questions: 17, Answers: 5)
Asked on September 28, 2017 6:47 pm
24 views
Answers (1)
1
Private answer

Please use the following code.

Sub Req_AfterPost
On Error Resume Next
Dim strTo
Dim strSubject
Dim strComment

Set tdc = TDConnection
Set objReqFactory = tdc.reqFactory
Set ReqFilter = objReqFactory.Filter
pQCAdmin = ''singu.sivanaga@orasi.com'' 'Send the email to the Quality Center Administrator
'Change for your own environment
Req_AssignedTo = Req_Fields.Field(''RQ_USER_01'').Value
pEmail = tdc.Customization.Users.User(Req_AssignedTo).Email
If len(pEmail)<1 Then 'If Requirement Author's email address is blank pEmail = pQCAdmin 'Send the email to the Quality Center Administrator Req_AssignedTo = pEmail 'Change for your own environment End If If Req_Fields(''RQ_REQ_REVIEWED'').Value = ''ReadyforReview'' Then strTO = Req_AssignedTo strSubject = ''The Status for Requirement # '' & Req_Fields(''RQ_REQ_ID'').value & '' Has Changed to '' & Req_Fields(''RQ_REQ_REVIEWED'').value strComment = ''The Status for Requirement # '' & Req_Fields(''RQ_REQ_ID'').value & '' Has Changed to '' & Req_Fields(''RQ_REQ_REVIEWED'').value TDConnection.sendmail strTo, strFrom, strSubject, strComment, NULL, ''HTML'' Set TDConnection = nothing MsgBox ''Mail Sent'' End if Set tdc = nothing Set objReqFactory = nothing On Error GoTo 0 End Sub

Marked as spam
Posted by (Questions: 0, Answers: 23)
Answered on September 28, 2017 6:49 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top