Not sure if it is the "most elegant way" but I just defined a property for
the color and mutated it based on the build status using an if statement. I
also have a base message that I modify using the build status and I use the
same approach.

String color= ...
String message = ""
If(started){
color =...
message+= "emoji"
} else if (success){
color=...
}

slackSend(color: color.....
On Thu, Apr 2, 2020, 7:40 AM Vitaly Karasik <[email protected]> wrote:

> Question regarding Slack Notification plugin in declarative pipeline: is
> there an elegant way to modify color and embed relevant emoji depends on
> currentBuild.currentResult?
> Or I should clone "slackSend" 3 times - for success, unstable and failed
> build?
>
> --
> 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/74fae4a9-0820-4784-a5bf-015af8c7cc65%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/74fae4a9-0820-4784-a5bf-015af8c7cc65%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAMMhyA3psviLC9LOE%2BO7jAxzev_%3DuKfmGMEYnA3fX0BCkwmB0w%40mail.gmail.com.

Reply via email to