Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

unable to update user in JIRA

dipali mose
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 4, 2018

I want to update existing jira user By REST API. here is my java code.

JSONObject data = new JSONObject();        json.put("active", "false");
        String getUser = "https://cloudcodes.atlassian.net/rest/api/2/user?username=newuser";        URL obj        = new URL(getUser);
        HttpURLConnection conn = (HttpURLConnection) obj.openConnection();        conn.setRequestProperty("Content-Type", "application/json");        conn.setDoOutput(true);        conn.setRequestMethod("PUT");
         String authentication = new String(Base64.encode("AdminEmail" + ":" + "password"));
        conn.setRequestProperty ("Authorization", "Basic " + authentication);        conn.setReadTimeout(60000);        conn.setConnectTimeout(60000);

and i got the error: java.io.IOException: Server returned HTTP response code: 405 for URL: https://cloudcodes.atlassian.net/rest/api/2/user?username=newuser


0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events