can we send attachment in mail through QC on a partcular event call (686 Views)
Reply
Highlighted
Occasional Contributor
Posts: 6
Registered: ‎04-05-2013
Message 1 of 3 (686 Views)

can we send attachment in mail through QC on a partcular event call

Can we send Attachment in mail through QC on a partcular event in QC workflow script editor

Esteemed Contributor
Posts: 565
Registered: ‎10-20-2008
Message 2 of 3 (680 Views)

Re: can we send attachment in mail through QC on a particular event call

Hi

 

Yes it is possible.

 

Check the help in the Workflow Script Editor and search on TDConnection. There are loads of examples with one on sending emails.

 

You will have to find the attachments via an Attachment Factory which should be too difficult to code

 

Thanks

MArtin

 

 

Occasional Visitor
Posts: 5
Registered: ‎06-28-2013
Message 3 of 3 (633 Views)

Re: can we send attachment in mail through QC on a partcular event call

Hi,

 

I want to send an email on the QC workflow to send a specific file attachment of a given bug to another user

 

In bug_afterpost level workflow function, I used the following code:

 

Sub Bug_AfterPost
  On Error Resume Next

 

 

 

 

.....After update the bug

   dim objBugFactory
  dim objBug
  dim attachFact
  dim attachList
  dim AttachmentList() 'As Variant

  Set objBugFactory = TDConnection.BugFactory


  Set objBug = objBugFactory.Item(Bug_Fields("BG_BUG_ID").value)

  MsgBox "Bug en question: " &  objBug.ID

 

 Set attachFact = objBug.Attachments

 

 Set attachList = attachFact.NewList("")

 

  ReDim Preserve AttachmentList(attachList.Count - 1)

  

  Dim i
  i = LBound(AttachmentList)

  For Each theAttachment In attachList
         AttachmentList(i) = theAttachment.ServerFileName
          i = i + 1
  Next

  ' Array is populated. Let's see what we have:
  Dim fName
  For Each fName In AttachmentList
      MsgBox "The AttachmentList element is: " & fName
  Next

 

  TDConnection.SendMail "cp_meditel", "cp_frs", ObjetP, ComP, AttachmentList

 

Thank you for helping me

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.