Re: terinary operators in declared pipeline

2022-06-02 Thread 'Martin Schmude' via Jenkins Users
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

Re: terinary operators in declared pipeline

2022-06-02 Thread 'Martin Schmude' via Jenkins Users
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"

Re: terinary operators in declared pipeline

2022-06-02 Thread 'Martin Schmude' via Jenkins Users
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"

terinary operators in declared pipeline

2022-06-01 Thread Rita Morgan
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