Use case: Search Jira Users by Project
Before you start
- Verify Permissions: Ensure you have permission to access Jira users in your Unity project. Typically, this means being a project member or having specific collaboration settings access.
- Project Context: Know the Unity Project ID you want to search users for.
- 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 project:
- Get the Project ID: Identify the Unity Project to search users for.
- 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
SearchUsersByProjectAsyncmethod 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 = "jane";
var users = await jiraManagementService.SearchUsersByProjectAsync(
projectId: projectId,
jiraServerConfigId: jiraServerConfigId,
query: query,
cancellationToken: cancellationToken);
Error Handling
- 400 Bad Request: Invalid input.
- 401 Unauthorized: Authentication required.
- 403 Forbidden: Insufficient permissions.