History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2685
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Steve Luo
Reporter: Michael Plank
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

Jira issue creation with custom field not working anymore

Created: 05/Apr/16 10:57 AM   Updated: 14/Apr/16 01:51 AM
Component/s: None
Affects Version/s: 6.1.9
Fix Version/s: 6.1.12

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: None
Image Attachments:

1. Screen Shot 2016-04-05 at 13.01.36.png
(166 kb)

2. Screen Shot 2016-04-05 at 13.01.58.png
(45 kb)


 Description  « Hide
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}

 All   Comments   Work Log   Change History      Sort Order:
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

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.

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!

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.

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