Use case: Search Jira Issues
Before you start
- Verify Permissions: Ensure you have permissions to view issues in the linked Jira project. This typically requires a valid Jira user account with browse/search rights.
- Linked Jira Configuration: Confirm that the Unity project is linked to a valid Jira ProjectConfig via a ServerConfig.
- Jira Project Context: Ensure the Jira Project ID and configuration context are valid and active.
- Search Query: Prepare your search query or filter criteria (e.g., text, status, assignee).
How do I...?
To search for Jira issues from a Unity project, follow these steps:
- Ensure a Jira Link Exists: Your Unity project must already be linked to a Jira ProjectConfig.
- Prepare the search query: Define your search string or filter parameters as needed.
- Use the SDK: Call the
SearchIssuesAsyncmethod in the Unity Collaboration SDK with the required properties. - Process the Response: Iterate through the returned issues and extract relevant fields (e.g., key, summary, status).
Example:
var query = "status='In Progress'";
var results = await jiraIssueService.SearchIssuesAsync(
projectId: projectId,
jiraProjectConfigId: jiraProjectConfigId,
query: query,
includeSubTasks: true,
cancellationToken: cancellationToken);
Error Handling
- 400 Bad Request: Invalid input.
- 401 Unauthorized: Authentication required.
- 403 Forbidden: Insufficient permissions.