Hello I am trying to Automate to update the fixVersion field of tickets in Jira using Jenkins "Jira Issue Results Updater.
Ive used the following Parameters:
Jira REST Base URL: https://<IP:port>/jira/rest/api/2
Jira Custom field to be edited: fixVersion
Jira Custom field value: <value>
Bu the I am getting the error below:
Unable to connect to REST service to set field
java.io.IOException: Server returned HTTP response code: 400 for URL
Also, I've tried a workaround by running a curl command which is:
Command:
curl -D- -u <username>:<password> -X PUT -d "{\"update\":{\"fixVersions\":[{\"set\":[{\"id\":\"<value>\"}]}]}}" -H "Content-Type: application/json" "https://<IP:Port>/jira/rest/api/2/issue/<issue-key>"
But I got the below:
HTTP/1.1 400 Bad Request
{"errorMessages":[],"errors":{"fixVersions":"Version id '<value>' is not valid"}}
Thanks in advance.
I used your curl command and it worked just fine. It only broke with a 400 Bad Request when I used an invalid version ID value.
Maybe you're using the version name instead of ID. The ID value is the ID value stored in the database and not the version name.
An alternative to using the ID is using the NAME.
Example:
Using version's id:
curl -D- -u admin:pw -X PUT -d "{\"update\":{\"fixVersions\":[{\"set\":[{\"id\":\"10100\"}]}]}}" -H "Content-Type: application/json" "http://localhost:8080/rest/api/2/issue/SSP-22"
Using version's name:
curl -D- -u admin:pw -X PUT -d "{\"update\":{\"fixVersions\":[{\"set\":[{\"name\":\"v1\"}]}]}}" -H "Content-Type: application/json" "http://localhost:8080/rest/api/2/issue/SSP-22"
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.