Quickstart¶
This flow reads the organization, creates a project, discovers its default boards, and creates a ticket.
import com.newfoundcodes.okatana.OkatanaClient;
import com.newfoundcodes.okatana.model.Priority;
import com.newfoundcodes.okatana.request.CreateProjectRequest;
import com.newfoundcodes.okatana.request.CreateTicketRequest;
var client = OkatanaClient.builder()
.baseUrl(System.getenv("OKATANA_URL"))
.apiKey(System.getenv("OKATANA_API_KEY"))
.build();
String organizationId = System.getenv("OKATANA_ORGANIZATION_ID");
var organization = client.organizations().get(organizationId);
var project = client.organizations().createProject(
organizationId,
new CreateProjectRequest("Platform", "PLAT")
.description("Platform engineering work")
);
var boards = client.projects().listBoards(project.id());
var ticket = client.projects().createTicket(
project.id(),
new CreateTicketRequest("Design deployment runbook")
.boardSlug("open")
.priority(Priority.HIGH)
.descriptionHtml("<p>Create, review, and validate the runbook.</p>")
);
System.out.println(ticket.id());
Okatana currently creates Open, Hold, In-progress, Pull Request, and Deployed boards with a new project. Use the returned board list before creating additional workflow stages.
Failure handling¶
Catch narrow exceptions when an action depends on the status: