Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-49088

"JQL filter" writing format is what ,I need to filter "status"

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Component/s: jira-trigger-plugin
    • Labels:
      None
    • Environment:
      jenkins ver : 2.7.4
      jira trigger plugin ver : 0.5.1
    • Similar Issues:

      Description

      test1:

      JQL filter:empty;

      Parameter mapping:

      Jenkins parameter:JIRA_ISSUE_STATUS

      Issue attribute path:status.name

      Jenkins parameter:JIRA_ISSUE_STATUS2

      Issue attribute path:status

      output:
      JIRA_ISSUE_STATUS=SIT
      JIRA_ISSUE_STATUS2=Status{self=http://jira.guodong.cn/rest/api/2/status/10101, name=SIT, id=10101, description=, iconUrl=http://jira.guodong.cn/images/icons/statuses/generic.png}

       

       

      test2:

      JQL filter:status=“SIT”

      jenkins not work。

      test3:

      JQL filter:status.name=“SIT”

      field "status.name" not found。

       

      Caused by: RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={}, errorMessages=[字段 'status.name' 不存在。]}]}

       

       

      java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor320.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324) at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:52) at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100) at org.kohsuke.stapler.IndexDispatcher.dispatch(IndexDispatcher.java:26) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) at org.kohsuke.stapler.MetaClass$11.dispatch(MetaClass.java:380) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649) at org.kohsuke.stapler.Stapler.service(Stapler.java:238) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135) at javax.servlet.FilterChain$doFilter.call(Unknown Source) at com.ceilfors.jenkins.plugins.jiratrigger.ExceptionLoggingFilter.doFilter(ExceptionLoggingFilter.groovy:29) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at javax.servlet.FilterChain$doFilter$0.call(Unknown Source) at com.ceilfors.jenkins.plugins.jiratrigger.webhook.JiraWebhookCrumbExclusion.process(JiraWebhookCrumbExclusion.groovy:22) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:58) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:499) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544) at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.util.concurrent.ExecutionException: RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={}, errorMessages=[字段 'status.name' 不存在。]}]} at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:289) at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:262) at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:91) at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:69) at com.atlassian.jira.rest.client.internal.async.DelegatingPromise.get(DelegatingPromise.java:107) at java_util_concurrent_Future$get.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133) at com.ceilfors.jenkins.plugins.jiratrigger.jira.JrjcJiraClient.validateIssueKey(JrjcJiraClient.groovy:62) at com.ceilfors.jenkins.plugins.jiratrigger.jira.JiraClient$validateIssueKey$0.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133) at com.ceilfors.jenkins.plugins.jiratrigger.JiraTrigger.run(JiraTrigger.groovy:42) at com.ceilfors.jenkins.plugins.jiratrigger.JiraTrigger$run.call(Unknown Source) at com.ceilfors.jenkins.plugins.jiratrigger.JiraTriggerExecutor.scheduleBuildsInternal(JiraTriggerExecutor.groovy:79) at com.ceilfors.jenkins.plugins.jiratrigger.JiraTriggerExecutor.this$2$scheduleBuildsInternal(JiraTriggerExecutor.groovy) at sun.reflect.GeneratedMethodAccessor329.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182) at com.ceilfors.jenkins.plugins.jiratrigger.JiraTriggerExecutor.scheduleBuilds(JiraTriggerExecutor.groovy:68) at com.ceilfors.jenkins.plugins.jiratrigger.JiraTriggerExecutor$scheduleBuilds.callCurrent(Unknown Source) at com.ceilfors.jenkins.plugins.jiratrigger.JiraTriggerExecutor.changelogCreated(JiraTriggerExecutor.groovy:51) at com.ceilfors.jenkins.plugins.jiratrigger.webhook.JiraWebhookListener$changelogCreated.call(Unknown Source) at com.ceilfors.jenkins.plugins.jiratrigger.webhook.JiraWebhook.processEvent(JiraWebhook.groovy:65) at com.ceilfors.jenkins.plugins.jiratrigger.webhook.JiraWebhook$processEvent.callCurrent(Unknown Source) at com.ceilfors.jenkins.plugins.jiratrigger.webhook.JiraWebhook.doIndex(JiraWebhook.groovy:50) ... 72 more Caused by: RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={}, errorMessages=[字段 'status.name' 不存在。]}]} 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:268) at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:158) at com.google.common.util.concurrent.Futures$6.run(Futures.java:975) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:149) at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:134) at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:170) at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53) at com.atlassian.util.concurrent.Promises$Of$3.apply(Promises.java:268) at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:158) at com.google.common.util.concurrent.Futures$6.run(Futures.java:975) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:149) at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:134) at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:170) at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53) 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)

        Attachments

          Activity

          Hide
          ceilfors Wisen Tanasa added a comment -

          Not sure if JQL Filter is what you need. Try to use the "Changelog matcher" feature.

          Show
          ceilfors Wisen Tanasa added a comment - Not sure if JQL Filter is what you need. Try to use the "Changelog matcher" feature.
          Hide
          czd890 cheng zd added a comment -

          “Changelog matche” can not use conditional expressions.

          JQL: (status=A or status =B) and project=C

          Show
          czd890 cheng zd added a comment - “Changelog matche” can not use conditional expressions. JQL: (status=A or status =B) and project=C
          Hide
          ceilfors Wisen Tanasa added a comment -

          Unfortunately that is not supported at the moment. If you are up for it, this following workaround theoretically would work:

          • Job A => Job X
          • Job B => Job X

          Job A and B above listens to status A or B respectively. Job X is the actual job you are trying to trigger. Whether it is the right project or not.

          Project matches can be done via "key" issue attribute path.

          Show
          ceilfors Wisen Tanasa added a comment - Unfortunately that is not supported at the moment. If you are up for it, this following workaround theoretically would work: Job A => Job X Job B => Job X Job A and B above listens to status A or B respectively. Job X is the actual job you are trying to trigger. Whether it is the right project or not. Project matches can be done via "key" issue attribute path.
          Hide
          czd890 cheng zd added a comment -

          Only so,thanks

          Show
          czd890 cheng zd added a comment - Only so,thanks

            People

            • Assignee:
              ceilfors Wisen Tanasa
              Reporter:
              czd890 cheng zd
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: