Use case: Get Jira Projects from a Server Configuration
Before you start
- Verify Permissions: Ensure you have permission to access Jira projects in your Unity Organization. Typically, this means being an admin or having specific collaboration settings access.
- Organization Context: Know the Organization identifier (GUID) of the Unity Organization where the Jira server is configured.
- Jira ServerConfig ID: Obtain the unique identifier (GUID) of the Jira ServerConfig from which to fetch projects.
How do I...?
To get the list of Jira projects from a server configuration:
- Get the Organization ID: Identify the Unity Organization where the Jira server is configured.
- Get the Jira ServerConfig ID: Obtain the ServerConfig ID to use for the request.
- Use the SDK: Call the
GetProjectsAsyncmethod in the Unity Collaboration SDK with the required properties. - Process the Response: Iterate through the returned projects and extract relevant fields (e.g., key, name, project type).
Example:
var projects = await jiraManagementService.GetProjectsAsync(
organizationId: organizationId,
jiraServerConfigId: jiraServerConfigId,
cancellationToken: cancellationToken);
Error Handling
- 400 Bad Request: Invalid input.
- 401 Unauthorized: Authentication required.
- 403 Forbidden: Insufficient permissions.