Hi everyone,
We are trying to save all the changelog (String) via expand of all issues. Where we itterate trough all issues in Java.
We are using JIRA sever. In the browser I can open the page:
'.../rest/api/issue/{key}?expand=changelog'
The main goal of this approach is, to get the transitions of the different status exp.
"created": "2022-05-11T08:14:34.000+0200",
"items": [
{
"field": "status",
"fieldtype": "jira",
"from": "1",
"fromString": "Open",
"to": "3",
"toString": "In Progress"
}
]
If i try it with this code:
public static String urlReader(String theUrl) // .../rest/api/issue/{key}?expand=changelog
{
StringBuilder content = new StringBuilder();
// Use try and catch to avoid the exceptions
try
{
URL url = new URL(theUrl); // creating a url object
URLConnection urlConnection = url.openConnection(); // creating a urlconnection object
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String line;
while ((line = bufferedReader.readLine()) != null)
{
content.append(line + "\n");
}
bufferedReader.close();
}
catch(Exception e)
{
e.printStackTrace();
}
System.out.println(content.toString());
return content.toString();
}Im getting this error: Server returned HTTP response code: 401 for URL:
Do someone know how to solve this problem?
Thanks