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

Ticket creation fails while trying to set mandatory select list field

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins version: 2.133
      Plugin version: 2.0.7

      Below is the code snippet for creating defect, 

      testDataPublishers: [
                          jiraTestResultReporter(
                              configs: [
                                  jiraStringField(fieldKey: 'summary', value: '${DEFAULT_SUMMARY}'),
                                  jiraStringField(fieldKey: 'description', value: '${DEFAULT_DESCRIPTION}'),
                                  jiraStringArrayField(fieldKey: 'labels', values: [jiraArrayEntry(value: 'Jenkins'), jiraArrayEntry(value:'Automation')]),
                                  jiraStringArrayField(fieldKey: 'components', values: [jiraArrayEntry(value: 'System Test')]),
                                  jiraStringField(fieldKey:'customfield_19030', value:"No - New Use Case" )
                              ],
                              projectKey: 'CAS',
                              issueType: '1',
                              autoRaiseIssue: true,
                              autoResolveIssue: false,
                              autoUnlinkIssue: false,
                          )
                      ]

      field customfield_19030 is a custom field of type select (Single select). I tied using both jiraStringField as well as jiraStringArrayField, but in both the cases getting the below exception

      ERROR: Could not create issue for test Declarative: Post Actions / com.citrix.cas.dummy.tests.DummyTests.switchPassFailRestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={components=expected Object, customfield_19030=Could not find valid 'id' or 'value' in the Parent Option object.}, errorMessages=[]}]}
      	at com.atlassian.jira.rest.client.internal.async.DelegatingPromise.claim(DelegatingPromise.java:47)
      	at org.jenkinsci.plugins.JiraTestResultReporter.JiraUtils.createIssueInput(JiraUtils.java:114)
      	at org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher.raiseIssues(JiraTestDataPublisher.java:248)
      	at org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher.contributeTestData(JiraTestDataPublisher.java:187)
      	at hudson.tasks.junit.JUnitResultArchiver.parseAndAttach(JUnitResultArchiver.java:199)
      	at hudson.tasks.junit.pipeline.JUnitResultsStepExecution.run(JUnitResultsStepExecution.java:50)
      	at hudson.tasks.junit.pipeline.JUnitResultsStepExecution.run(JUnitResultsStepExecution.java:23)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
      	at hudson.security.ACL.impersonate(ACL.java:290)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	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: RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={components=expected Object, customfield_19030=Could not find valid 'id' or 'value' in the Parent Option object.}, errorMessages=[]}]}
      	at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2.apply(AbstractAsynchronousRestClient.java:176)
      	at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2.apply(AbstractAsynchronousRestClient.java:170)
      	at com.atlassian.httpclient.api.ResponsePromiseMapFunction.apply(ResponsePromiseMapFunction.java:67)
      	at com.atlassian.httpclient.api.ResponsePromiseMapFunction.apply(ResponsePromiseMapFunction.java:11)
      	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)
      	... 3 more
      

            catalinluta Catalin Luta
            kashikarh Harshad Kashikar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: