Hey mates,
I am trying to add/update the link in issue using JIRA API. But i am getting Bad request (error 400)
JSON code:
{
"update": {
"issuelinks": [{
"type": {
"name": "Relates"
},
"inwardIssue": {
"key": "XPTO-29432"
},
"OutwardIssue": {
"key": "XPTO-29072"
}
}
]
}
}
URI: https://XPTO.jira.com/rest/api/2/issueLink
Code i am using to PUT
HttpPut put = new HttpPut(uri);
put.setHeader("Content-Type", "application/json");
put.setHeader("Authorization", "Basic " + args.getJiraAuthToken());
HttpEntity entity = new ByteArrayEntity(json.getBytes("UTF-8"));
put.setEntity(entity);
HttpResponse response = httpClient.execute(put);
Note:
my json object is the one i tell u in this text.
Do you have any idea what is going on? I already try with POST but still not working.