I am using below code to update fields using api
def baseUrl = new URL("http://xxxx/xxxxxxx/abc");
HttpURLConnection conn= (HttpURLConnection) baseUrl.openConnection();
log.debug(conn.getContentLength())
conn.setInstanceFollowRedirects( false );
conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
conn.setRequestProperty("Accept", "application/json");
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setRequestMethod("POST");
//conn.connect();
log.debug(conn.getResponseCode() as String)
But I am receiving 411 error , not sure on how to set content length.can someone help me with this
Try to use "Customer Data" from "JIRA Automation"
Hi,
I'm not sure how exactly you're getting this error. Is this Jira Cloud or Jira Server? If Server what version of Jira is this?
Also what specific REST endpoint are you using when trying to POST here? What payload is being sent via REST here?
I found a few related threads in community to this, such as https://community.atlassian.com/t5/Answers-Developer-Questions/Bamboo-REST-API-to-create-branches/qaq-p/477013 which suggests to look at https://serverfault.com/questions/164220/is-there-a-way-to-avoid-nginx-411-content-length-required-errors
Which indicates this could be a proxy problem, that you can work around with the header of
curl -i -X PUT -H 'Content-Length: 0' 'http://www.example.com/test'
Perhaps this can help.
Please let me know.
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.