Use case: Search Jira Users by Organization
Before you start
- Verify Permissions: Ensure you have permission to access Jira users 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 to search users against.
- Search Query: Prepare your search query or filter criteria (e.g., username, email, display name).
How do I...?
To search for Jira users by organization:
- 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.
- Prepare the search query: Define your search string or filter parameters as needed.
- Use the SDK: Call the
SearchUsersByOrganizationAsyncmethod in the Unity Collaboration SDK with the required properties. - Process the Response: Iterate through the returned users and extract relevant fields (e.g., user key, display name, email). You may want to filter or sort the results for your use case.
Example:
var query = "john";
var users = await jiraManagementService.SearchUsersByOrganizationAsync(
organizationId: organizationId,
jiraServerConfigId: jiraServerConfigId,
query: query,
cancellationToken: cancellationToken);
Error Handling
- 400 Bad Request: Invalid input.
- 401 Unauthorized: Authentication required.
- 403 Forbidden: Insufficient permissions.