You can code
def result = (branch == "main"
? "@daily"
: (branch == "master"
? "@hourly"
: ""))
Maybe you find a switch more readable:
def result
switch(branch) {
case "main":
result = "@daily"
break
case "mast
You can code
def result = (branch == "main" ? "@daily" : (branch == "master" ? "@hourly"
: ""))
Maybe you find a switch more readable:
def result
switch(branch) {
case "main": result = "@daily"
break
case "master": result = "@hourly"
You can code
```
def result = (branch == "main" ? "@daily" : (branch == "master" ? "@hourly"
: ""))
```
Maybe you find a switch more readable:
```
def result
switch(branch) {
case "main": result = "@daily"
break
case "master": result = "@hourly"
I know you can do terninary operations. Is it possible to chain them?
so,
if branch = "main" ? "@daily":""
if branch = "master" ?" @hourly":""
and so on?
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop