This is more of a general Pipeline matter than just Declarative, fwiw. I've
opened https://issues.jenkins-ci.org/browse/JENKINS-42952 for this and will
get a PR up shortly.

A.

On Mar 20, 2017 15:41, "Nick Le Mouton" <[email protected]> wrote:

Hi,

My current jobs use the Slack plugin which notifies a channel when a build
completes, e.g. job name - #2423 Success after 1 min 49 sec. I'm trying to
replicate the same message in declarative pipelines, but I can't seem to
find a way to get the build duration. I have tried using
currentBuild.duration (which ends up evaluating to 0) and tried
currentBuild.rawBuild.getDurationString(), but Jenkins throws an error
about not being able to run functions from this context.

How can I get this to work?

Thanks

-- 
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 [email protected].
To view this discussion on the web visit https://groups.google.com/d/ms
gid/jenkinsci-users/9f994a50-f671-42fe-ac77-b75a608daa53%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/9f994a50-f671-42fe-ac77-b75a608daa53%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPbPdOZ4QiVUEOQpgmbZHkD9LvT%2B7a%3DGUWbHWaQvhvMFZ9wMcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to