A java client for the JIRA REST APIs.
implementation("io.github.primelib:jira4j-rest-v3:<latestVersion>")
Click to view instructions for other build tools.
Consumer Specification Approach
JiraRESTV3ConsumerApi client = JiraRESTV3Factory.create(spec -> {
spec.baseUrl("https://your-domain.atlassian.net");
spec.api(JiraRESTV3ConsumerApi.class);
spec.bearerAuth(authSpec -> {
authSpec.token("<your-personal-access-token>");
});
});
client.getIssue(spec -> {
spec.issueIdOrKey("TEST-1");
});
Parameter Approach
JiraRESTV3Api client = JiraRESTV3Factory.create(spec -> {
spec.baseUrl("https://your-domain.atlassian.net");
spec.api(JiraRESTV3Api.class);
spec.bearerAuth(authSpec -> {
authSpec.token("<your-personal-access-token>");
});
});
client.getIssue("TEST-1", null, null, null, null, null);
NOTE: The Parameter Approach
can break if the API changes. The Consumer Specification Approach
is more resilient to API changes.
implementation("io.github.primelib:jira4j-rest-v2:<latestVersion>")
Click to view instructions for other build tools.
Consumer Specification Approach
JiraRESTV2ConsumerApi client = JiraRESTV2Factory.create(spec -> {
spec.baseUrl("https://your-domain.atlassian.net");
spec.api(JiraRESTV2ConsumerApi.class);
spec.bearerAuth(authSpec -> {
authSpec.token("<your-personal-access-token>");
});
});
client.getIssue(spec -> {
spec.issueIdOrKey("TEST-1");
});
Parameter Approach
JiraRESTV2Api client = JiraRESTV2Factory.create(spec -> {
spec.baseUrl("https://your-domain.atlassian.net");
spec.api(JiraRESTV2Api.class);
spec.bearerAuth(authSpec -> {
authSpec.token("<your-personal-access-token>");
});
});
client.getIssue("TEST-1", null, null, null, null, null);
NOTE: The Parameter Approach
can break if the API changes. The Consumer Specification Approach
is more resilient to API changes.
Released under the MIT License.