<< Back to previous view |
[QB-2685] Jira issue creation with custom field not working anymore
|
|
Status: | Resolved |
Project: | QuickBuild |
Component/s: | None |
Affects Version/s: | 6.1.9 |
Fix Version/s: | 6.1.12 |
Type: | Bug | Priority: | Major |
Reporter: | Michael Plank | Assigned To: | Steve Luo |
Resolution: | Fixed | Votes: | 0 |
Remaining Estimate: | Unknown | Time Spent: | Unknown |
Original Estimate: | Unknown |
File Attachments: | Screen Shot 2016-04-05 at 13.01.36.png Screen Shot 2016-04-05 at 13.01.58.png |
Description |
After upgrading from QB 6.0.35 to QB 6.1 the Jira issue creation step is not working anymore.
We have a step that creates a issue of type Bug. A Bug has a mandatory custom field (id 12900). In the "extra attributes" field of the "create Jira issue" step, I have: 12900=${vars.getValue("branchName") == "trunk" ? "DEV" : "SPRINT"} This now throws an exception. It works, if I use another issue type (like Research) which doesn't require a custom field to be set. So it has definitely something to do with the custom field. I tried different options: customfield_12900=${vars.getValue("branchName") == "trunk" ? "DEV" : "SPRINT"} customfield_12900=DEV but I always get this error: {code} 12:52:00,343 INFO - Running step... 12:52:00,353 INFO - Start creating issue for project APM 12:52:01,859 WARN - Unknown or unsupported field: project 12:52:06,216 INFO - Executing post-execute action... 12:52:06,216 ERROR - Step 'master>createJiraIssue' is failed. com.pmease.quickbuild.plugin.tracker.core.TrackerException: RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={customfield_12900=Could not find valid 'id' or 'value' in the Parent Option object.}, errorMessages=[]}]} at com.pmease.quickbuild.plugin.tracker.jira.client.RestJiraClient.createIssue(RestJiraClient.java:403) at com.pmease.quickbuild.plugin.tracker.jira.step.CreateIssueStep.run(CreateIssueStep.java:257) at com.pmease.quickbuild.plugin.tracker.jira.step.CreateIssueStep$$EnhancerByCGLIB$$99bc6d22.CGLIB$run$0(<generated>) at com.pmease.quickbuild.plugin.tracker.jira.step.CreateIssueStep$$EnhancerByCGLIB$$99bc6d22$$FastClassByCGLIB$$64110c88.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215) at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:261) at com.pmease.quickbuild.plugin.tracker.jira.step.CreateIssueStep$$EnhancerByCGLIB$$99bc6d22.run(<generated>) at com.pmease.quickbuild.stepsupport.Step.execute(Step.java:548) at com.pmease.quickbuild.stepsupport.StepExecutionJob.executeStepAwareJob(StepExecutionJob.java:31) at com.pmease.quickbuild.stepsupport.StepAwareJob.executeBuildAwareJob(StepAwareJob.java:45) at com.pmease.quickbuild.BuildAwareJob.execute(BuildAwareJob.java:60) at com.pmease.quickbuild.grid.GridJob.run(GridJob.java:106) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={customfield_12900=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 com.pmease.quickbuild.plugin.tracker.jira.client.RestJiraClient.createIssue(RestJiraClient.java:401) ... 16 more Caused by: RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={customfield_12900=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: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:295) at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:185) at com.google.common.util.concurrent.Futures$4.run(Futures.java:1154) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293) at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150) at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135) at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185) at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53) at com.atlassian.util.concurrent.Promises$Of$3.apply(Promises.java:295) at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:185) at com.google.common.util.concurrent.Futures$4.run(Futures.java:1154) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293) at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150) at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135) at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185) 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 12:52:06,344 INFO - Executing post-execute action... {code} |
Comments |
Comment by Michael Plank [ 05/Apr/16 10:59 AM ] |
I saw this issue before creating that one, but it doesn't sound as it would fix my problem:
http://track.pmease.com/browse/QB-2670 |
Comment by Steve Luo [ 06/Apr/16 01:01 AM ] |
What is your JIRA version? What is the type of your field (text, number, or ...)?
You can tick "Use SOAP" option in your configuration settings -> Issue Tracker -> JIRA -> Advanced section, and see if it can work if you are using JIRA 6.x or below. |
Comment by Michael Plank [ 06/Apr/16 06:39 AM ] |
Thx for the hint, I got it working again.
As you explained, I switched to SOAP, since our Jira Version is on 6.3.15. The type of field is a combo box with 3 different options: DEV, SPRINT, PROD The following extra attribute options now worked for me: 12900=DEV 12900=${vars.getValue("branchName") == "trunk" ? 19280 : 19281} where 19280 and 19281 are the IDs of DEV and SPRINT values. Feel free to close this issue, Thx! |
Comment by Steve Luo [ 06/Apr/16 09:50 AM ] |
Yes, SOAP interface can work. But since JIRA 7.0, the SOAP interface is removed. So this issue still exists.
For this issue, the hard part is that there is no easy way to get custom field options according to Atlassian KB below: https://confluence.atlassian.com/jirakb/how-to-retrieve-available-options-for-a-multi-select-customfield-via-jira-rest-api-815566715.html So, we can only fix this issue partially. That is, if the custom field is a select, you have to use the option id instead of the option name. Like: customfield_12900=10003 here 10003 is the id of option DEV. You may have to consult your JIRA admin for this id. |
Comment by Michael Plank [ 06/Apr/16 10:10 AM ] |
Hi Steve,
yeah, it works fine with the option IDs. As written in my previous comment, I already figured out the IDs and it works now. Thx |