Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

403 error when using /rest/atm/1.0/testresult only via the code

Hi all,

I'm trying to use the adaptavist API for updating test results from my automation code.

I've managed to create the post request and run it successfully using Postman BUT when I use the same request with the same headers, body etc. in the code - I get a 403 error.

That's the code I'm using:

public static void sendPOST(String testKey, String status) throws IOException {
String POST_PARAMS = buildRequestBody(testKey,status);
URL obj = new URL(POST_URL);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Cache-Control", "no-cache");
con.setRequestProperty("Authorization", "Basic *********");

// For POST only - START
OutputStream os = con.getOutputStream();
// For POST only - END

int responseCode = con.getResponseCode();
System.out.println("POST Response Code :: " + responseCode);
if (responseCode == HttpURLConnection.HTTP_OK) { //success
BufferedReader in = new BufferedReader(new InputStreamReader(
String inputLine;
StringBuffer response = new StringBuffer();

while ((inputLine = in.readLine()) != null) {

// print result
} else {
System.out.println("POST request didn't work.");

Please help.


1 answer

Hi @Ifatsharifi,

If you are getting a 403 that's surely an authentication problem. Actually, Jira handles authentication even before the request reaches the add-on.

How are you building the user/pass parameter? It should be:

Authorization: Basic user:password

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

553 views 15 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you