feat(linear): add project_id filter for sync (#938)
Add project_id filter for Linear sync When linear.project_id is configured, bd linear sync will only fetch issues belonging to that project instead of all team issues. Closes #937
This commit is contained in:
@@ -26,6 +26,7 @@ var linearCmd = &cobra.Command{
|
||||
Configuration:
|
||||
bd config set linear.api_key "YOUR_API_KEY"
|
||||
bd config set linear.team_id "TEAM_ID"
|
||||
bd config set linear.project_id "PROJECT_ID" # Optional: sync only this project
|
||||
|
||||
Environment variables (alternative to config):
|
||||
LINEAR_API_KEY - Linear API key
|
||||
@@ -586,6 +587,10 @@ func getLinearClient(ctx context.Context) (*linear.Client, error) {
|
||||
if endpoint, _ := store.GetConfig(ctx, "linear.api_endpoint"); endpoint != "" {
|
||||
client = client.WithEndpoint(endpoint)
|
||||
}
|
||||
// Filter to specific project if configured
|
||||
if projectID, _ := store.GetConfig(ctx, "linear.project_id"); projectID != "" {
|
||||
client = client.WithProjectID(projectID)
|
||||
}
|
||||
}
|
||||
|
||||
return client, nil
|
||||
|
||||
Reference in New Issue
Block a user