Quality Center / ALM Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

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

Occasional Contributor

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

2 REPLIES
Esteemed Contributor Esteemed Contributor

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

 

 

Highlighted
Occasional Visitor

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