YouTrack API for Java
๐งโ Java library to interact with YouTrack's REST API.
Usage
// Import classes: import dev.floofy.libs.youtrack.api.ApiClient; import dev.floofy.libs.youtrack.api.ApiException; import dev.floofy.libs.youtrack.api.Configuration; import dev.floofy.libs.youtrack.api.auth.*; import dev.floofy.libs.youtrack.api.models.*; import dev.floofy.libs.youtrack.api.openapi.DefaultApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://youtrack.jetbrains.com:443/api"); // Configure HTTP bearer authorization: permanentToken HttpBearerAuth permanentToken = (HttpBearerAuth) defaultClient.getAuthentication("permanentToken"); permanentToken.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); String categories = "categories_example"; // String | Boolean reverse = true; // Boolean | Indicates whether the order of returning activities is from newest to oldest or the opposite. If \"false\", then the oldest activity item that matches a selected filter is returned first. If \"true\", then the newest activity is returned first. By default, \"false\". String start = "start_example"; // String | Start timestamp of the time interval the activity timestamp belongs to. If the parameter is not set, it is considered to be 0. String end = "end_example"; // String | End timestamp of the time interval the activity timestamp belongs to. If the parameter is not set, it is considered as Long.MAX_VALUE. String author = "author_example"; // String | Parameter to filter activities by the author. The database id or login, or Hub id, or 'me' for the current logged in user could be specified. String issueQuery = "issueQuery_example"; // String | Issues search query. Read more about search syntax. String fields = "$type,added,author($type,id,login,name,ringId),category($type,id),field($type,customField($type,fieldType($type,id),id,localizedName,name),id,name),id,removed,target,targetMember,timestamp"; // String | Integer $skip = 56; // Integer | Integer $top = 56; // Integer | try { List<ActivityItem> result = apiInstance.activitiesGet(categories, reverse, start, end, author, issueQuery, fields, $skip, $top); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DefaultApi#activitiesGet"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } }
Installation
Documentation: https://auguwu.github.io/youtrack-kotlin-api
Version: 1.2.0
Gradle
Kotlin DSL
repositories {
maven {
url = uri("https://maven.floofy.dev/repo/releases")
}
}
dependencies {
implementation("dev.floofy.youtrack:youtrack-api:
"
)
}
Groovy DSL
repositories {
maven {
url "https://maven.floofy.dev/repo/releases"
}
}
dependencies {
implementation "dev.floofy.youtrack:youtrack-api:
"
}
Maven
<repositories>
<repository>
<id>noel-mavenid>
<url>https://maven.floofy.dev/repo/releasesurl>
repository>
repositories>
<dependencies>
<dependency>
<groupId>dev.floofy.youtrackgroupId>
<artifactId>youtrack-apiartifactId>
<version>{{VERSION}}version>
<type>pomtype>
dependency>
dependencies>
License
youtrack-kotlin-api is released under the MIT License.