Use case: Create a Jira Project Configuration
Before you start
- Verify Permissions: Ensure you have the appropriate permissions in your Unity Organization to create a Jira ProjectConfig. Typically, you must be an admin or have specific collaboration settings access.
- Organization Context: Know the Organization identifier (GUID) of the Unity Organization where this configuration should be created.
- Jira ServerConfig ID: You'll need the unique identifier (GUID) of the Jira ServerConfig to which this configuration will be linked.
- Jira Project ID: Identify the Jira project you want to link.
- Default Reporter: Identify the Jira user ID to use as the default reporter.
How do I...?
To create a Jira ProjectConfig, follow these steps:
- Get the Jira ServerConfig ID: Retrieve or confirm the ServerConfig ID where the ProjectConfig will be created.
- Get the Organization ID: Retrieve or confirm the Unity Organization ID where the ServerConfig is located.
- Prepare the ProjectConfig Payload: Prepare data for the request (Jira project ID, default reporter ID, restriction flag, and linked Unity project IDs).
- Use the SDK: Call the
CreateProjectConfigAsyncmethod in the Unity Collaboration SDK with the required properties. - Handle Responses: Ensure your implementation verifies whether the config was successfully created and handles any errors appropriately.
Example:
var jiraProjectId = new JiraProjectId("Jira Project ID");
var reporter = new JiraUserId("ID of the reporter for the config");
bool isRestricted = false;
var unityProjectIds = new List<ProjectId> { /* Unity Project IDs to link */ };
var jiraProjectConfigId = await jiraConfigService.CreateProjectConfigAsync(
organizationId: organizationId,
jiraServerConfigId: jiraServerConfigId,
jiraProjectId: jiraProjectId,
defaultReporterId: reporter,
isRestricted: isRestricted,
linkedUnityProjectIds: unityProjectIds,
cancellationToken: cancellationToken);
Error Handling
- 400 Bad Request: Invalid input.
- 401 Unauthorized: Authentication required.
- 403 Forbidden: Insufficient permissions.