[JIRA] (JENKINS-57125) Extended choice parameter plugin does not pass parameter if called via a buildWithParameters URL request

3 views
Skip to first unread message

Parthakumar.Roy@ibm.com (JIRA)

unread,
Apr 20, 2019, 7:33:02 AM4/20/19
to jenkinsc...@googlegroups.com
Parthakumar Roy created an issue
 
Jenkins / Bug JENKINS-57125
Extended choice parameter plugin does not pass parameter if called via a buildWithParameters URL request
Issue Type: Bug Bug
Assignee: vimil
Components: extended-choice-parameter-plugin
Created: 2019-04-20 11:32
Environment: Jenkins 2.150.3, Extended Choice Parameter Plug-In 0.76
Priority: Major Major
Reporter: Parthakumar Roy

This issue was reported in https://issues.jenkins-ci.org/browse/JENKINS-16639  and seems to  have been resolved in 2013.

However, I am facing the issue with exact same symptoms using Jenkins 2.150.3 and extended choice parameter plugin 0.76.

The following is an approximate cURL equivalent, because I am using python requests library to do the POST 

curl -X POST https://<JENKINS_URL>/job/xyz/buildWithParameters --data {"json": {"parameter": [{"name": "option1", "value":"value1"}, {"name":"text1", "value": "value2"}]}} 

 

The Python code from which the above curl was derived is shown below:

requests.post("https://<JENKINS_URL>/job/xyz/buildWithParameters", 
             auth=(<USERNAME>, <PASSWORD>),
             data={'json': {'parameter': [{'name': 'option1', 'value': 'value1'}, {'name': 'text1', 'value': 'value2'}]}}
             )

where 'option1' is the name of the extended- choice-parameter (radio buttons), and the 'value1' is the string value associated with the particular choice

 

The Jenkins job gets started (following along on the Jenkins UI) but quickly fails with 

/tmp/jenkins4137547693282782703.sh: line 9: option1: unbound variable 

 

To confirm that the parameter is indeed not being passed, I click on the job id in the Jenkins UI, and click on Parameters from the options in the left pane, and "option1" is missing, whereas  "text1" is there and is correctly set to "value2"

 

However, the same job run from the Jenkins UI proceeds to completion, the job URL is of course different

https://<JENKINS_URL>/job/xyz/build?delay=0sec

 

In fact, if the above curl operation is run with https://<JENKINS_URL>/job/xyz/build instead, it also proceeds to completion. However, only when the URL has buildWithParameters does it return the correct `Location` header in the response with the URL of the queue where the job can be monitored as it is running. This bug is blocking our automation efforts.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

balaviyer@gmail.com (JIRA)

unread,
Nov 29, 2019, 2:41:03 PM11/29/19
to jenkinsc...@googlegroups.com
bala Iyer commented on Bug JENKINS-57125
 
Re: Extended choice parameter plugin does not pass parameter if called via a buildWithParameters URL request

Hello

 

Any update on this. As I am also facing the same issue, when I am call a choice parameterized job remotely

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages