Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-9023

Jira-Ticketer: Attribute values for some custom fields are not mapped correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 18.0.4
    • Fix Version/s: 18.0.4
    • Component/s: Ticketing
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Sprint:
      Horizon - Jan 25th, Horizon - Feb 1st, Horizon - Feb 8th

      Description

      There are reports, that custom fields of type option may not work properly.
      Especially when changing to "id" resolution:

      Hi Markus,

      Sorry for direct approach but I see that you are the one who wrote the new custom ticket fields feature.

      I've been following the guide at and just pulling my hair out trying to get the custom fields working!

      http://docs.opennms.org/opennms/releases/latest/guide-admin/guide-admin.html#ga-ticketing-jira

      Any tips would be welcome! I've tried to include as much useful logs and configs below.

      ---------------------------------------------------------------------------------------------------------
      
      [root@nms-dev1 etc]# cat jira.properties 
      jira.host=http://jirastage.tmxatrium.lan/
      jira.username=opennms
      jira.password=XXXXXXXXX
      jira.project=ATR
      jira.type=10806
      jira.resolve=Resolve Issue
      jira.reopen=Reopen Issue
      jira.status.open=Open,In Progress,Reopened
      jira.status.closed=Closed
      jira.status.cancelled=Cancelled
      jira.attribute.customfield_10614.resolution=id
      
      ---------------------------------------------------------------------------------------------------------
      
      [root@nms-dev1 etc]# cat drools-ticketer.properties 
      #
      # Drools Tickter Configuration
      #
      drools-ticketer.rules-file=/opt/opennms/etc/drools-ticketer-rules.drl
      
      ---------------------------------------------------------------------------------------------------------
      
      [root@nms-dev1 etc]# cat drools-ticketer-rules.drl 
      package org.opennms.netmgt.ticketd;
      import org.opennms.netmgt.model.OnmsAlarm;
      import org.opennms.netmgt.model.OnmsNode;
      import org.opennms.netmgt.model.OnmsCategory;
      import org.opennms.api.integration.ticketing.Ticket;
      
      dialect "mvel"
      
      global Ticket ticket;
      
      rule "TicketDefaults"
      salience 100
       when
        $alarm : OnmsAlarm()
       then
        ticket.addAttribute("customfield_10608", "2017-01-01T00:00:00+00:00")
        ticket.addAttribute("customfield_10614", 10329)
      end
      
      ---------------------------------------------------------------------------------------------------------
      
      opennms> jira:list-fields -k ATR -i Atrium\ Incident -s
      Fetching custom fields for project with key 'ATR' and issue type with name 'Atrium Incident'.
      
      Project Infrastructure (ATR)
      ------------------------------
      
      All fields for issue type Atrium Incident (id: 10806)
      ------------------------------------------------------------
      Name                           Id                   Custom     Type
      ABOX                           customfield_11000    true       array
      Assignee                       assignee             false      user
      Attachment                     attachment           false      array
      Circuit                        customfield_11101    true       array
      Component/s                    components           false      array
      Core Device                    customfield_11100    true       array
      Customer                       customfield_11102    true       array
      Description                    description          false      string
      End Time                       customfield_10609    true       datetime
      Issue Type                     issuetype            false      issuetype
      Labels                         labels               false      array
      Linked Issues                  issuelinks           false      array
      Location                       customfield_11109    true       option-with-child
      Organizations                  customfield_11800    true       any
      Priority                       priority             false      priority
      Project                        project              false      project
      Reporter                       reporter             false      user
      Request participants           customfield_11208    true       array
      Service Connect                customfield_11115    true       array
      Source                         customfield_10614    true       option
      Start Time                     customfield_10608    true       datetime
      Summary                        summary              false      string
      
      ---------------------------------------------------------------------------------------------------------
      
                  <select class="select cf-select" name="customfield_10614" id="customfield_10614">
                          <option value="">None</option>
                                          <option value="10914">3rd Party Email</option>
                                      <option value="10915">3rd Party Call</option>
                                      <option value="10327">Customer Email</option>
                                      <option value="10326">Customer Call</option>
                                      <option value="10328">Monitoring Email</option>
                                      <option value="10329">Monitoring OpenNMS</option>
                                      <option value="10700">Monitoring Nagios</option>
                  </select>
      
      ---------------------------------------------------------------------------------------------------------
      
      2017-01-19 16:14:03,320 DEBUG [OpenNMS.TroubleTicketer-Thread] o.o.n.e.EventIpcManagerDefaultImpl: run: calling onEvent on OpenNMS.TroubleTicketer for event uei.opennms.org/troubleTicket/create dbid 0 with time 2017-01-19T16:14:03.000+0000
      2017-01-19 16:14:03,324 DEBUG [OpenNMS.TroubleTicketer-Thread] o.o.n.t.DroolsTicketerServiceLayer: Initializing ticket from alarm: [OnmsAlarm@2df949c3 alarmid = 11234, distPoller = [OnmsDistPoller@6c9348e1 id = '00000000-0000-0000-0000-000000000000', label = 'localhost', location = 'localhost', type = 'OpenNMS']]
      2017-01-19 16:14:03,324 ERROR [OpenNMS.TroubleTicketer-Thread] o.o.n.t.DroolsTicketerServiceLayer: KnowledgeBase is NULL, creating basic ticket form alarm.
      2017-01-19 16:14:03,948 ERROR [OpenNMS.TroubleTicketer-Thread] o.o.n.t.DefaultTicketerServiceLayer: Unable to create ticket for alarm: Failed to create issue.
      org.opennms.api.integration.ticketing.PluginException: Failed to create issue.
      	at org.opennms.netmgt.ticketer.jira.JiraTicketerPlugin.saveOrUpdate(JiraTicketerPlugin.java:239) ~[?:?]
      	at org.opennms.netmgt.ticketd.OSGiBasedTicketerPlugin.saveOrUpdate(OSGiBasedTicketerPlugin.java:60) ~[org.opennms.features.ticketing.daemon-18.0.3.jar:?]
      	at org.opennms.netmgt.ticketd.DefaultTicketerServiceLayer.createTicketForAlarm(DefaultTicketerServiceLayer.java:195) [org.opennms.features.ticketing.daemon-18.0.3.jar:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_60]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_60]
      	at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_60]
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) [org.apache.servicemix.bundles.spring-aop-4.0.5.RELEASE_1.jar:?]
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) [org.apache.servicemix.bundles.spring-aop-4.0.5.RELEASE_1.jar:?]
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) [org.apache.servicemix.bundles.spring-aop-4.0.5.RELEASE_1.jar:?]
      	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) [org.apache.servicemix.bundles.spring-tx-4.0.5.RELEASE_1.jar:?]
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) [org.apache.servicemix.bundles.spring-tx-4.0.5.RELEASE_1.jar:?]
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) [org.apache.servicemix.bundles.spring-tx-4.0.5.RELEASE_1.jar:?]
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [org.apache.servicemix.bundles.spring-aop-4.0.5.RELEASE_1.jar:?]
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) [org.apache.servicemix.bundles.spring-aop-4.0.5.RELEASE_1.jar:?]
      	at com.sun.proxy.$Proxy131.createTicketForAlarm(Unknown Source) [?:?]
      	at org.opennms.netmgt.ticketd.TroubleTicketer.handleCreateTicket(TroubleTicketer.java:221) [org.opennms.features.ticketing.daemon-18.0.3.jar:?]
      	at org.opennms.netmgt.ticketd.TroubleTicketer.onEvent(TroubleTicketer.java:158) [org.opennms.features.ticketing.daemon-18.0.3.jar:?]
      	at org.opennms.netmgt.eventd.EventIpcManagerDefaultImpl$EventListenerExecutor$2.run(EventIpcManagerDefaultImpl.java:176) [org.opennms.features.events.daemon-18.0.3.jar:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_60]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_60]
      	at org.opennms.core.concurrent.LogPreservingThreadFactory$2.run(LogPreservingThreadFactory.java:106) [opennms-util-18.0.3.jar:?]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_60]
      Caused by: java.util.concurrent.ExecutionException: RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={customfield_10614=Source is required.}, errorMessages=[]}]}
      	at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:286) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63) ~[guava-17.0.jar:?]
      	at com.atlassian.jira.rest.client.internal.async.DelegatingPromise.get(DelegatingPromise.java:102) ~[?:?]
      	at org.opennms.netmgt.ticketer.jira.JiraTicketerPlugin.saveOrUpdate(JiraTicketerPlugin.java:237) ~[?:?]
      	... 22 more
      Caused by: com.atlassian.jira.rest.client.api.RestClientException: [ErrorCollection{status=400, errors={customfield_10614=Source is required.}, errorMessages=[]}]
      	at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2.apply(AbstractAsynchronousRestClient.java:173) ~[?:?]
      	at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2.apply(AbstractAsynchronousRestClient.java:167) ~[?:?]
      	at com.atlassian.httpclient.api.ResponsePromiseMapFunction.apply(ResponsePromiseMapFunction.java:48) ~[?:?]
      	at com.atlassian.httpclient.api.ResponsePromiseMapFunction.apply(ResponsePromiseMapFunction.java:12) ~[?:?]
      	at com.atlassian.util.concurrent.Promises$Of$3.apply(Promises.java:285) ~[?:?]
      	at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:162) ~[?:?]
      	at com.google.common.util.concurrent.Futures$5.run(Futures.java:1231) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53) ~[guava-17.0.jar:?]
      	at com.atlassian.util.concurrent.Promises$Of$3.apply(Promises.java:285) ~[?:?]
      	at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:162) ~[?:?]
      	at com.google.common.util.concurrent.Futures$5.run(Futures.java:1231) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185) ~[guava-17.0.jar:?]
      	at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53) ~[guava-17.0.jar:?]
      	at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$1$1.run(SettableFuturePromiseHttpPromiseAsyncClient.java:46) ~[?:?]
      	at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$ThreadLocalDelegateRunnable$1.run(SettableFuturePromiseHttpPromiseAsyncClient.java:197) ~[?:?]
      	at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient.runInContext(SettableFuturePromiseHttpPromiseAsyncClient.java:90) ~[?:?]
      	at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$ThreadLocalDelegateRunnable.run(SettableFuturePromiseHttpPromiseAsyncClient.java:192) ~[?:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_60]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_60]
      	... 1 more
      2017-01-19 16:14:03,983 DEBUG [OpenNMS.TroubleTicketer-Thread] o.o.n.e.EventIpcManagerDefaultImpl: sending: org.opennms.netmgt.xml.event.Log@67c8bc73[header=<null>,events=org.opennms.netmgt.xml.event.Events@55a68963[event=[org.opennms.netmgt.xml.event.Event@45ffe49[uuid=<null>,dbid=<null>,dist-poller=<null>,creation-time=Thu Jan 19 16:14:03 GMT 2017,master-station=<null>,mask=<null>,uei=uei.opennms.org/troubleTicket/communicationError,source=Ticketd,nodeid=<null>,time=Thu Jan 19 16:14:03 GMT 2017,host=<null>,interface=<null>,snmphost=<null>,service=<null>,snmp=<null>,parms=[org.opennms.netmgt.xml.event.Parm@5797051f[parmName=reason,value=org.opennms.netmgt.xml.event.Value@759e00ba[content=Failed to create issue.,type=string,encoding=text]]],descr=<null>,logmsg=<null>,severity=<null>,pathoutage=<null>,correlation=<null>,operinstruct=<null>,autoaction=[],operaction=[],autoacknowledge=<null>,loggroup=[],tticket=<null>,forward=[],script=[],ifIndex=<null>,ifAlias=<null>,mouseovertext=<null>,alarm-data=<null>]]]]
      

        Attachments

          Activity

            People

            • Assignee:
              mvr Markus von Rüden
              Reporter:
              mvr Markus von Rüden
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: