0
votes

I am using job dsl to create jenkins jobs. I want to send emails out on job failures. I have already installed and configured 'ext-email' plugin. I have also added following section to my job DSL script

extendedEmail('[email protected]', 'Oops', 'Something broken')

However I get following error

groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.dsl.Job.extendedEmail() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.String) values: [[email protected], Oops, Something broken] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:78) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149) at script1410384571000472680582$_run_closure1.doCall(script1410384571000472680582.groovy:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)

Any idea how can I get around it

2

2 Answers

1
votes

Figured out the answer

extendedEmail('[email protected]', 'Oops', 'Something broken') has to be wrapped inside publisher i.e. it should look like

publisher { extendedEmail('[email protected]', 'Oops', 'Something broken') }

1
votes

You can always refer to this API there if you search a method you get the context in which it should present.. though you already got your answer but just to write so that it can help someone