Skip navigation links

Package org.llorllale.youtrack.api

Fluent, object-oriented API for YouTrack.

See: Description

Package org.llorllale.youtrack.api Description

Fluent, object-oriented API for YouTrack.

Login

YouTrack supports various authentication strategies. youtrack-api implements:

Example: final Session session = new PermanentToken(youtrackUrl, myToken).login();
See the org.llorllale.youtrack.api.session package for more info.

Main Entry Point

The main entrypoint for the API is the YouTrack interface. Obtain an instance of the default implementation like this:
final YouTrack yt = new DefaultYouTrack(session);.

Projects

The Projects interface is used to find projects.
Example:
   final Optional<Project> project = new DefaultYoutrack(session)
       .projects()          //returns the Projects interface
       .get("projectId");   //returns an Optional<Project>
See interfaces Projects and Project.

Issues

You can find an issue like this:
   final Optional<Issue> issue = project.issues().get("issueId");
To create an issue, use Issues.create(String, String):
   final Issue is = project.issues().create("summary", "description");
 
See Issues for more info.

Fields of an Issue

Note:
It is important to know that some fields typically found in most issue tracking software - like State and Priority - are not first class citizens in YouTrack, although they are typically present in project configurations on most teams. First class attributes of issues in YouTrack include properties such as creationDate, summary, and description (although optional). Behind the scenes, YouTrack supports fields like State and Priority through the use of custom fields that are configured (sometimes preconfigured) through a project's settings.

Usage:
To access a project's preconfigured fields:
   final Stream<ProjectField> fields = project.fields().stream();
To access all possible values for a field:
   final Stream<FieldValue> values = projectField.values();
Updating an issue's fields can be done via Issue.update(). Example:
   final ProjectField state = project.fields().stream()
        .filter(f -> "State".equals(f.name()))
        .findAny().get();
  final FieldValue done = state.values()
        .filter(v -> "Done".equals(v.asString())
        .findAny().get();
  final Issue issueUpdated = issue.update().field(state, done);
Since:
0.9.0
See Also:
Project Site.
Skip navigation links

Copyright © 2017–2018 George Aristy. All rights reserved.