OpsGenieNotifier in Configuration as Code
Asked by Waldemar Kotarba:

How to write configuration OpsGenieNotifier in Configuration as Code ?

I trying use this code:

unclassified:  
opsGenieNotifier:  
apiUrl: <https://api.opsgenie.com>  
apiKey: "Jenkins-devops-opsgenie"  
teams: devops  
tags: jenkins-devops  
but failed on Jenkins start and Jenkins has been stopped:  
io.jenkins.plugins.casc.UnknownAttributesException: opsGenieNotifier: Invalid configuration elements for type: class com.opsgenie.integration.jenkins.OpsGenieNotifier$DescriptorImpl : apiUrl,apiKey,teams,tags. ?  
? Available attributes : ?  
? at io.jenkins.plugins.casc.BaseConfigurator.handleUnknown(BaseConfigurator.java:389) ?  
? at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:374) ?  
? at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:293) ?  
? at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:360) ?  
? at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:293) ?  
? at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$9(ConfigurationAsCode.java:830) ?  
? at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:773) ?  
? at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:830) ?  
? at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:816) ?  
? at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:695) ?  
? at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:352) ?  
? at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:341) ?  
? Caused: io.jenkins.plugins.casc.ConfigurationAsCodeBootFailure ?  
? at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:343) ?  
? Caused: java.lang.reflect.InvocationTargetException ?  
? at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ?  
? at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ?  
? at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ?  
? at java.base/java.lang.reflect.Method.invoke(Method.java:568) ?  
? at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:109) ?  
? Caused: java.lang.Error ?  
? at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:115) ?  
? at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:185) ?  
? at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305) ?  
? at jenkins.model.Jenkins$5.runTask(Jenkins.java:1170) ?  
? at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:221) ?  
? at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:120) ?  
? at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) ?  
? at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ?  
? at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ?  
? at java.base/java.lang.Thread.run(Thread.java:840)  
Caused: org.jvnet.hudson.reactor.ReactorException ?  
? at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:290) ?  
? at jenkins.InitReactorRunner.run(InitReactorRunner.java:49) ?  
? at jenkins.model.Jenkins.executeReactor(Jenkins.java:1205) ?  
? at jenkins.model.Jenkins.\<init\>(Jenkins.java:992) ?  
? at hudson.model.Hudson.\<init\>(Hudson.java:86) ?  
? at hudson.model.Hudson.\<init\>(Hudson.java:82) ?  
? at hudson.WebAppMain$3.run(WebAppMain.java:247) ?  
? Caused: hudson.util.HudsonFailedToLoad ?  
? at hudson.WebAppMain$3.run(WebAppMain.java:264)  
hudson.lifecycle.Lifecycle#onStatusUpdate: Stopping Jenkins


Answers:
author: Skyler Ataide
body: Hi there [@Waldemar Kotarba](/t5/user/viewprofilepage/user-id/5444730)!

Thanks for reaching out here in the Opsgenie community! In order to best troubleshoot this issue, may I ask that you [open up a support ticket](https://support.atlassian.com/contact/#/) with our Opsgenie support team so that we can discuss further what you are looking to do in Opsgenie. Please be sure to select **Technical issues and bugs** and **Opsgenie** as the product so that our Opsgenie support engineers can assist here further. ?


Tags: cloud