So i want to get json data from my jira project which has a jql selection included:
https://(system).atlassian.net/rest/api/3/search?jql=project=(projectname) AND issuetype=Bug AND (priority = High OR priority = Blocker)
The problem is, that i have to authenticate myself to Jira, but unfortunately i don't know how to do that in Java.
I hope someone can help me out!
Hi @Alexander kuttner
Welcome to community. Please look at the sample code for Java to see an example of authenticating your user using REST API. For example
// This code sample uses the 'Unirest' library: // http://unirest.io/java.html HttpResponse<JsonNode> response = Unirest.get("https://your-domain.atlassian.net/rest/api/3/jql/autocompletedata") .basicAuth("email@example.com", "<api_token>") .header("Accept", "application/json") .asJson(); System.out.println(response.getBody());
Hey @Alexander kuttner, may I ask why don't you use a selfhosted environment? It is a lot easier there to authenticate, as you don't have to handle API tokens and 2FA ...
May i ask what a selfhosted environment is?
When you have Jira installed on your servers, for example "jira.[yourdomain.com]", it is called "self hosted", instead of Jira cloud with [name].atlassian.net. Functions in Jira cloud (especially in the free tier) may be limited.
Ahh it's because we are doing a diploma and our manager gave it to us.
It looks like you're new here. Sign in or register to get started.