x
login Signup

email only when different outcome

Hi n email notifiers there are different options, "on error", "always", "on abort", etc etc.

Is there a way to email only if job has different outcome than the last run? For example success -> error, or error -> abort

I've thought about adding a procedure step but that would become part of the test itself. I need something post-steps and pre-email-notifier. Any thoughts/solutions?

Thx Dean

avatar image By dechaoz05 21 asked Aug 19, 2014 at 05:10 PM
more ▼
(comments are locked)
10|750 characters needed characters left

3 answers: sort voted first

Found the answer: 1. in job steps do this: ( create a /myProject/status property 1st ) ectool createProperty "/myJob/sendMail" --value "false" if [ "$[/myProject/status]" != "$myStatus" ] ; then ectool setProperty "/myJob/sendMail" --value "true" fi ectool setProperty "/myProject/status" --value $myStatus

  1. in email notificaiton. use condition trigger $[/javascript if(getProperty("/myJob/sendMail") == 'true') true; else false;]

avatar image By annie 47 answered Sep 11, 2014 at 08:13 PM
more ▼
(comments are locked)
10|750 characters needed characters left

You would have to save the outcome of your last job as a project property for example (somehwre that will exist between jobs) Then you condition for your email notifier would something like:

 $[/javascript "$[/myProject/lastOutcome]" != "$[/myJob/outcome]" ];


avatar image By lrochette 6k answered Aug 19, 2014 at 06:14 PM
more ▼
(comments are locked)
10|750 characters needed characters left
Your answer
toggle preview:

Up to 8 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.