Sending only the latest attachment, not all existing attachments from the workitem

General question about the package, problems, solutions
apugazhenthy
Posts: 15
Joined: Mon Jun 27, 2016 8:16 am

Sending only the latest attachment, not all existing attachments from the workitem

Postby apugazhenthy » Wed Jun 29, 2016 10:16 am

Hi Pavel,

http://cqadmin.org/wiki/Notification_Examples#Sending_Emails_with_Attachments
I have used above example code for sending email with attachment. Thanks for this code, it is working perfectly.

This code sending all attachments present in the workitem but I want to send only the latest attachments (i.e. attachment added during last update) not all attachment updated earlier. so please help me to achieve this requirement.


Many Thanks,
Pugazhenthy A

Pavel
Posts: 281
Joined: Fri Dec 12, 2008 12:19 am

Re: Sending only the latest attachment, not all existing attachments from the workitem

Postby Pavel » Wed Jun 29, 2016 12:46 pm

Hi,

Please check comments in that example. For the attachments that has not been loaded yet, the file name would contain path delimiters. Newly added attachments could be distinguished this way.
Another way would be to compare record to its original using CQ API, and add newly added attachments, if any.

Pavel

apugazhenthy
Posts: 15
Joined: Mon Jun 27, 2016 8:16 am

Re: Sending only the latest attachment, not all existing attachments from the workitem

Postby apugazhenthy » Fri Jul 01, 2016 5:50 am

Pavel wrote:Hi,

Please check comments in that example. For the attachments that has not been loaded yet, the file name would contain path delimiters. Newly added attachments could be distinguished this way.
Another way would be to compare record to its original using CQ API, and add newly added attachments, if any.

Pavel


Thank you Pavel :) ...

apugazhenthy
Posts: 15
Joined: Mon Jun 27, 2016 8:16 am

Re: Sending only the latest attachment, not all existing attachments from the workitem

Postby apugazhenthy » Tue Jul 05, 2016 10:36 am

Hi Pavel,

It sending only latest attachments added in the current session which worked after I removed else part(which is adding all existing attachments) from the example code provided.

but now the problem is after I connected RTC(Rational Team Concert) to CQ, if I add any attachments in RTC it get synched to CQ but not sending with mail. If I enabled that else condition again(which I removed earlier for send only latest attachments) then it sending all the attachments as well as current session attachment added through RTC.

I want to send only the latest attachments which added from RTC in the current update. Please help me for this requirement.

Many thanks,
Pugazhenthy A

Pavel
Posts: 281
Joined: Fri Dec 12, 2008 12:19 am

Re: Sending only the latest attachment, not all existing attachments from the workitem

Postby Pavel » Tue Jul 05, 2016 11:14 am

Hi,

Should I draft a contract?

Thank you,
Pavel

apugazhenthy
Posts: 15
Joined: Mon Jun 27, 2016 8:16 am

Re: Sending only the latest attachment, not all existing attachments from the workitem

Postby apugazhenthy » Wed Jul 06, 2016 2:08 am

Hi Pavel,

Is this required any major things to do? or else simple code changes is required then I will do my own.please give me some hints.



Thank You,
Pugazhenthy A

Pavel
Posts: 281
Joined: Fri Dec 12, 2008 12:19 am

Re: Sending only the latest attachment, not all existing attachments from the workitem

Postby Pavel » Wed Jul 06, 2016 9:12 am

Hi,

It would require some codding and testing. If file path approach does not work, I would try to implement comparison of the current entity object attachments with attachments of the same record entity stored in the database (accessible with LoadEntity session object method).

Pavel


Return to “Email Notification Package Q&A”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest

cron