Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I create default NotificationConfig by the code? #112

Open
luchianenco opened this issue Sep 29, 2017 · 1 comment
Open

How can I create default NotificationConfig by the code? #112

luchianenco opened this issue Sep 29, 2017 · 1 comment

Comments

@luchianenco
Copy link

Can anybody explain what I am doing wrong. When I try to create NotificationConfig:

import jenkins.*
import jenkins.model.*
import hudson.model.*
import java.util.logging.Logger
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.domains.*
import hudson.util.Secret
import jenkins.plugins.hipchat.model.NotificationConfig
import jenkins.plugins.hipchat.model.NotificationType
import org.jenkinsci.plugins.plaincredentials.impl.*
import jenkins.plugins.hipchat.model.notifications.Notification.Color
import java.util.*

...

typeFailed = NotificationType.FAILURE
colorFailed = Color.RED
buildFailed = new NotificationConfig(true, true, typeFailed, colorFailed, "", "{{ hipchat_build_failed_message }}")

list = new ArrayList<NotificationConfig>()
list.add(buildFailed)

desc.setDefaultNotifications(list)

I get next error:

groovy.lang.GroovyRuntimeException: Could not find matching constructor for: jenkins.plugins.hipchat.model.NotificationConfig(java.lang.Boolean, java.lang.Boolean, jenkins.plugins.hipchat.model.NotificationType$4, jenkins.plugins.hipchat.model.notifications.Notification$Color, java.lang.String, java.lang.String)
@aldaris
Copy link

aldaris commented Jul 20, 2018

Nope, no idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants