Change subject in email-ext

41 views
Skip to first unread message

Faizan Javed

unread,
Apr 15, 2015, 3:06:35 AM4/15/15
to jenkins...@googlegroups.com
I am using email-ext plugin to trigger emails after the build fails or become unstable. The build becomes unstable when some of the tests fail and the build fails when the compilation fail.

Can we use conditions to display different customized subject depending on the cause of the email trigger?

Slide

unread,
Apr 15, 2015, 7:53:44 AM4/15/15
to jenkins...@googlegroups.com
You could use the SCRIPT token in the subject and have the decision making done in the groovy script. I do this for lots of things.

On Wed, Apr 15, 2015 at 12:06 AM Faizan Javed <faixa...@gmail.com> wrote:
I am using email-ext plugin to trigger emails after the build fails or become unstable. The build becomes unstable when some of the tests fail and the build fails when the compilation fail.

Can we use conditions to display different customized subject depending on the cause of the email trigger?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/78afab09-7faa-4721-98f7-54501aa6f9a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Faizan Javed

unread,
Apr 16, 2015, 2:52:33 AM4/16/15
to jenkins...@googlegroups.com
Can you show me an example of groovy script? 

Slide

unread,
Apr 17, 2015, 9:27:05 AM4/17/15
to jenkins...@googlegroups.com

def subject = 'Some Subject'

if(build.result == Result.SUCCESS) {

    subject += ' - Build Succeeded!'

}

subject // required so that this is "returned" from the script




Faizan Javed

unread,
Apr 23, 2015, 3:49:12 AM4/23/15
to jenkins...@googlegroups.com
I tried this script
The subject is displaying "def subject = 'Some Subject'"
Reply all
Reply to author
Forward
0 new messages