Class TaigaClient
This client supports authentication and a focused set of CRUD operations for projects, sprints (milestones), user stories, tasks, users, and task statuses.
Typical usage:
- Create a client instance with a Taiga host URL.
- Call
login(String, String)once to obtain a bearer token. - Call read/write methods (for example
getMyProjects()orcreateTask(long, Long, String, Long)).
All authenticated operations require a successful login first; otherwise an
IllegalStateException is thrown.
HTTP non-2xx responses are surfaced as runtime failures with response details. Methods that perform I/O declare checked exceptions from Java HTTP and JSON processing APIs.
Thread-safety: instances are not designed for concurrent mutable use because the authentication token is stored as mutable state.
- Version:
- 2026.05.27
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassignTaskToStory(long taskId, Long userStoryId) Assigns a task to a user story, or removes the current user-story association.createProject(String name, String description) Creates a new Taiga project.createSprint(long projectId, String name, String estimatedStart, String estimatedFinish) Creates a new sprint/milestone in a project.createTask(long projectId, Long userStoryId, String subject, Long assignedToUserId) Creates a new task in a project.createUserStory(long projectId, String subject, String description, Long milestoneId) Creates a new user story in a project.voiddeleteProject(long projectId) Deletes a project.voiddeleteSprint(long sprintId) Deletes a sprint/milestone.voiddeleteTask(long taskId) Deletes a task.voiddeleteUserStory(long storyId) Deletes a user story.Retrieves all projects accessible to the authenticated user.getProject(long projectId) Retrieves a project by id.getSprint(long sprintId) Retrieves a sprint/milestone by id.getSprints(long projectId) Retrieves all sprints/milestones for a project.getStories(long projectId) Retrieves all user stories for a project.getStoriesBySprint(long sprintId) Retrieves all user stories assigned to a sprint/milestone.getStory(long storyId) Retrieves a user story by id.getTask(long taskId) Retrieves a task by id.getTasks(long projectId) Retrieves all tasks for a project.getTaskStatuses(long projectId) Retrieves the available task statuses for a project.getTaskStatusMap(long projectId) Retrieves task statuses as a map from status id to status name.getUserById(long userId) Retrieves a Taiga user by id.voidAuthenticates the client using Taiga username/password credentials.moveStoryToSprint(long storyId, Long sprintId) Moves a user story to another sprint/milestone.moveTaskToStatus(long taskId, long statusId) Moves a task to another status.updateProject(long projectId, String name, String description) Updates a project.updateSprint(long sprintId, String name, String estimatedStart, String estimatedFinish) Updates a sprint/milestone.updateTask(long taskId, String subject, Long assignedToUserId, Long userStoryId) Updates a task.updateUserStory(long storyId, String subject, String description, Long milestoneId) Updates a user story.
-
Constructor Details
-
TaigaClient
Creates a new Taiga API client.- Parameters:
host- base Taiga API host, for examplehttps://api.taiga.io
-
-
Method Details
-
login
Authenticates the client using Taiga username/password credentials.- Parameters:
username- Taiga usernamepassword- Taiga password- Throws:
Exception- if authentication fails or the API does not return an auth token
-
getMyProjects
Retrieves all projects accessible to the authenticated user.- Returns:
- list of accessible Taiga projects
- Throws:
Exception- if the user is not authenticated or the API request fails
-
getProject
Retrieves a project by id.- Parameters:
projectId- Taiga project id- Returns:
- project information
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
getSprints
Retrieves all sprints/milestones for a project.- Parameters:
projectId- Taiga project id- Returns:
- list of sprints/milestones in the project
- Throws:
Exception- if the user is not authenticated or the API request fails
-
getSprint
Retrieves a sprint/milestone by id.- Parameters:
sprintId- Taiga sprint/milestone id- Returns:
- sprint information
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
getStories
Retrieves all user stories for a project.- Parameters:
projectId- Taiga project id- Returns:
- list of user stories in the project
- Throws:
Exception- if the user is not authenticated or the API request fails
-
getStory
Retrieves a user story by id.- Parameters:
storyId- Taiga user story id- Returns:
- user story information
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
getStoriesBySprint
Retrieves all user stories assigned to a sprint/milestone.- Parameters:
sprintId- Taiga sprint/milestone id- Returns:
- list of user stories assigned to the sprint
- Throws:
Exception- if the user is not authenticated or the API request fails
-
getTasks
Retrieves all tasks for a project.- Parameters:
projectId- Taiga project id- Returns:
- list of tasks in the project
- Throws:
Exception- if the user is not authenticated or the API request fails
-
getTask
Retrieves a task by id.- Parameters:
taskId- Taiga task id- Returns:
- task information
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
getUserById
Retrieves a Taiga user by id.- Parameters:
userId- Taiga user id- Returns:
- user information
- Throws:
Exception- if the user is not authenticated or the API request fails
-
getTaskStatuses
Retrieves the available task statuses for a project.- Parameters:
projectId- Taiga project id- Returns:
- list of task statuses configured for the project
- Throws:
Exception- if the user is not authenticated or the API request fails
-
getTaskStatusMap
Retrieves task statuses as a map from status id to status name.- Parameters:
projectId- Taiga project id- Returns:
- map where keys are status ids and values are status names
- Throws:
Exception- if the user is not authenticated or the API request fails
-
createProject
public TaigaProject createProject(String name, String description) throws IOException, InterruptedException Creates a new Taiga project.- Parameters:
name- project namedescription- project description; ifnull, an empty description is used- Returns:
- created project
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
createSprint
public TaigaSprint createSprint(long projectId, String name, String estimatedStart, String estimatedFinish) throws IOException, InterruptedException Creates a new sprint/milestone in a project.- Parameters:
projectId- Taiga project idname- sprint nameestimatedStart- estimated start date inyyyy-MM-ddformatestimatedFinish- estimated finish date inyyyy-MM-ddformat- Returns:
- created sprint/milestone
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
createUserStory
public TaigaUserStory createUserStory(long projectId, String subject, String description, Long milestoneId) throws IOException, InterruptedException Creates a new user story in a project.- Parameters:
projectId- Taiga project idsubject- story subject/titledescription- story description; ifnull, an empty description is usedmilestoneId- optional sprint/milestone id; may benull- Returns:
- created user story
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
createTask
public TaigaTask createTask(long projectId, Long userStoryId, String subject, Long assignedToUserId) throws IOException, InterruptedException Creates a new task in a project.- Parameters:
projectId- Taiga project iduserStoryId- optional parent user story id; may benullsubject- task subject/titleassignedToUserId- optional assigned user id; may benull- Returns:
- created task
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
moveStoryToSprint
public TaigaUserStory moveStoryToSprint(long storyId, Long sprintId) throws IOException, InterruptedException Moves a user story to another sprint/milestone.- Parameters:
storyId- Taiga user story idsprintId- destination sprint/milestone id; usenullto remove from sprint- Returns:
- updated user story
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
assignTaskToStory
public TaigaTask assignTaskToStory(long taskId, Long userStoryId) throws IOException, InterruptedException Assigns a task to a user story, or removes the current user-story association.- Parameters:
taskId- Taiga task iduserStoryId- destination user story id; usenullto detach the task- Returns:
- updated task
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
deleteTask
Deletes a task.- Parameters:
taskId- Taiga task id- Throws:
IOException- if the HTTP request failsInterruptedException- if the request is interrupted
-
deleteUserStory
Deletes a user story.- Parameters:
storyId- Taiga user story id- Throws:
IOException- if the HTTP request failsInterruptedException- if the request is interrupted
-
deleteSprint
Deletes a sprint/milestone.- Parameters:
sprintId- Taiga sprint/milestone id- Throws:
IOException- if the HTTP request failsInterruptedException- if the request is interrupted
-
deleteProject
Deletes a project.- Parameters:
projectId- Taiga project id- Throws:
IOException- if the HTTP request failsInterruptedException- if the request is interrupted
-
updateProject
public TaigaProject updateProject(long projectId, String name, String description) throws IOException, InterruptedException Updates a project.- Parameters:
projectId- Taiga project idname- new project name; ifnull, the name is not changeddescription- new project description; ifnull, the description is not changed- Returns:
- updated project
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
updateSprint
public TaigaSprint updateSprint(long sprintId, String name, String estimatedStart, String estimatedFinish) throws IOException, InterruptedException Updates a sprint/milestone.- Parameters:
sprintId- Taiga sprint/milestone idname- new sprint name; ifnull, the name is not changedestimatedStart- new estimated start date inyyyy-MM-ddformat; ifnull, it is not changedestimatedFinish- new estimated finish date inyyyy-MM-ddformat; ifnull, it is not changed- Returns:
- updated sprint/milestone
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
updateUserStory
public TaigaUserStory updateUserStory(long storyId, String subject, String description, Long milestoneId) throws IOException, InterruptedException Updates a user story.The current user story version is retrieved automatically and included in the PATCH request.
- Parameters:
storyId- Taiga user story idsubject- new story subject/title; ifnull, the subject is not changeddescription- new story description; ifnull, the description is not changedmilestoneId- new sprint/milestone id; ifnull, the milestone is not changed- Returns:
- updated user story
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
updateTask
public TaigaTask updateTask(long taskId, String subject, Long assignedToUserId, Long userStoryId) throws IOException, InterruptedException Updates a task.The current task version is retrieved automatically and included in the PATCH request.
- Parameters:
taskId- Taiga task idsubject- new task subject/title; ifnull, the subject is not changedassignedToUserId- new assigned user id; ifnull, assignment is not changeduserStoryId- new parent user story id; ifnull, parent story is not changed- Returns:
- updated task
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-
moveTaskToStatus
public TaigaTask moveTaskToStatus(long taskId, long statusId) throws IOException, InterruptedException Moves a task to another status.The current task version is retrieved automatically and included in the PATCH request.
- Parameters:
taskId- Taiga task idstatusId- destination task status id- Returns:
- updated task
- Throws:
IOException- if the HTTP request or JSON parsing failsInterruptedException- if the request is interrupted
-