slack-notification icon indicating copy to clipboard operation
slack-notification copied to clipboard

How to write conditional for border color?

Open rushfrisby opened this issue 7 years ago • 3 comments

How do you write a conditional statement for setting the border color?

I want to set the border based on the status. This would be the C# equivalent...

$(Agent.JobStatus) == "Succeeded" ? "good" : ($(Agent.JobStatus) == "Failed" ? "danger" : "warning")

I'm not sure how to write this as the value to put into the Border Color property though.

rushfrisby avatar Jul 13 '18 19:07 rushfrisby

you should create a powershell task that runs before your slack notification task. on that powershell task you can have your check and then create a vsts variable as a result of your check. then just use the variable on the border color field

gugavaro avatar Sep 19 '18 18:09 gugavaro

Thanks I'll give this a try

rushfrisby avatar Sep 27 '18 14:09 rushfrisby

@rushfrisby did you wrote something like that?

YotamHershk avatar May 03 '21 14:05 YotamHershk