| Crates.io | linear-issue-importer |
| lib.rs | linear-issue-importer |
| version | 0.1.0 |
| created_at | 2025-10-08 18:01:18.263002+00 |
| updated_at | 2025-10-08 18:01:18.263002+00 |
| description | Rust-based CLI tool for batch creating issues in Linear using their GraphQL API |
| homepage | |
| repository | https://github.com/SeanningTatum/linear-batch-update-script |
| max_upload_size | |
| id | 1874285 |
| size | 201,925 |
A powerful Rust-based CLI tool for batch creating and updating issues in Linear using their GraphQL API. This tool supports both JSON and CSV input formats and includes comprehensive validation, dry-run mode, and efficient batch processing capabilities.
# Clone the repository
git clone https://github.com/SeanningTatum/linear-batch-update-script
cd linear-batch-update-script
# Build the project
cargo build --release
# The binary will be available at target/release/linear-batch-update-script
Create a .env file in the project root (or copy from env.example):
cp env.example .env
Add your Linear API key to the .env file:
LINEAR_API_KEY=lin_api_YOUR_API_KEY_HERE
⚠️ IMPORTANT: Linear uses UUIDs for all IDs (teams, labels, users, states, projects, etc.). These look like: 12345678-1234-1234-1234-123456789012
We provide a Python helper script to fetch all IDs from your Linear workspace:
# Install Python dependencies
pip install requests python-dotenv
# Run the helper script (make sure LINEAR_API_KEY is set)
python examples/fetch_linear_ids.py
This script will:
linear_ids.json for referenceexample_issues_with_ids.json file with real IDs from your workspace"teamId": "YOUR_TEAM_ID" - Placeholder, won't work"labelIds": ["bug", "feature"] - Label names, not IDs"teamId": "b5a51e4e-2f3e-4d8a-9c1b-1a2b3c4d5e6f" - Correct UUID format"labelIds": ["a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d"] - Correct label UUID# Create issues from JSON file with team ID
./target/release/linear-batch-update-script create --file examples/issues.json --team-id YOUR_TEAM_ID
# Create issues from JSON file with team ID and project ID
./target/release/linear-batch-update-script create --file examples/issues.json --team-id YOUR_TEAM_ID --project-id YOUR_PROJECT_ID
# Create issues from CSV file
./target/release/linear-batch-update-script create-from-csv --file examples/issues.csv --team-id YOUR_TEAM_ID
# Create issues from CSV file with project ID
./target/release/linear-batch-update-script create-from-csv --file examples/issues.csv --team-id YOUR_TEAM_ID --project-id YOUR_PROJECT_ID
# Validate JSON file without creating issues
./target/release/linear-batch-update-script validate --file examples/issues.json
# Dry run (validate without creating)
./target/release/linear-batch-update-script create --file examples/issues.json --team-id YOUR_TEAM_ID --dry-run
# Custom batch size (default is 50)
./target/release/linear-batch-update-script create --file examples/issues.json --team-id YOUR_TEAM_ID --batch-size 25
Required Environment Variable:
LINEAR_API_KEY - Your Linear API key (set in .env file)Required Flags:
--file or -f - Path to the JSON or CSV file containing issues--team-id or -t - Linear team UUID (e.g., b5a51e4e-2f3e-4d8a-9c1b-1a2b3c4d5e6f)Optional Flags:
--project-id or -p - Linear project UUID to assign all issues to a project--dry-run or -d - Validate without creating issues--batch-size or -b - Number of issues to create per batch (default: 50)Example with all flags:
./target/release/linear-batch-update-script create \
--file examples/issues.json \
--team-id b5a51e4e-2f3e-4d8a-9c1b-1a2b3c4d5e6f \
--project-id a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d \
--batch-size 25 \
--dry-run
Create a JSON file with an array of issues. Each issue must have at least teamId and title:
[
{
"teamId": "YOUR_TEAM_ID",
"title": "Issue title",
"description": "Detailed description",
"priority": 2,
"estimate": 5,
"assigneeId": "USER_ID",
"labelIds": ["bug", "backend"],
"projectId": "PROJECT_ID",
"cycleId": "CYCLE_ID",
"dueDate": "2024-12-31"
}
]
Create a CSV file with the following columns:
title,description,assigneeId,priority,stateId,labelIds,projectId,cycleId,dueDate,estimate
"Issue title","Description here",,2,,"bug,frontend",PROJECT_ID,CYCLE_ID,2024-12-31,5
Note: When using CSV, you must provide the team ID via command line argument.
The script supports all Linear issue fields:
teamId - The team identifier (required)title - Issue title (required)description - Issue description in markdownassigneeId - User to assign the issue topriority - Priority level (0-4: None, Urgent, High, Normal, Low)stateId - Workflow state identifierlabelIds - Array of label identifiersprojectId - Project identifierprojectMilestoneId - Project milestone identifiercycleId - Cycle identifierparentId - Parent issue identifier (for sub-issues)dueDate - Due date (YYYY-MM-DD format)estimate - Complexity estimate pointssortOrder - Custom sort orderboardOrder - Position in board viewprioritySortOrder - Priority-based sort ordersubscriberIds - Array of subscriber user IDscreatedAt - Custom creation date (for imports)completedAt - Completion date (for imports)templateId - Template to use for creationuseDefaultTemplate - Use team's default templatecreateAsUser - Create as specific user (OAuth apps only)delegateId - Delegate to agent userslaType - SLA day count typeCreate a file my-issues.json:
[
{
"teamId": "TEAM_123",
"title": "Fix login bug",
"priority": 1
},
{
"teamId": "TEAM_123",
"title": "Add dark mode",
"priority": 3,
"estimate": 5
}
]
Run:
./target/release/linear-batch-update-script create --file my-issues.json
Create a file sprint-issues.csv:
title,description,assigneeId,priority,estimate
"Update API docs","Document v2 endpoints",USER_123,3,3
"Fix memory leak","Investigate worker process",USER_456,1,5
Run:
./target/release/linear-batch-update-script create-from-csv --file sprint-issues.csv --team-id TEAM_123
For large datasets, adjust the batch size:
./target/release/linear-batch-update-script create --file large-dataset.json --batch-size 100
The script provides detailed output for each operation:
🚀 Linear Batch Update Script
📄 Loading issues from: examples/issues.json
📋 Total issues to create: 5
📦 Processing 1 batch(es) of up to 50 issues each
⏳ Processing batch 1/1 (5 issues)...
✅ Batch 1 created successfully!
📝 Created: PROJ-123 - Fix login bug
📝 Created: PROJ-124 - Add dark mode
📊 Summary:
✅ Successfully created: 5 issues
❌ Failed: 0 issues
The script includes comprehensive error handling:
The script automatically handles rate limiting:
--batch-size flag--dry-run firstvalidate command to check your data"LINEAR_API_KEY environment variable not set"
.env file with your API key"Invalid team_id"
"Rate limit exceeded"
--batch-size 25"Invalid priority"
cargo test
cargo build --release
IssueInput struct in src/main.rsMIT License - See LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
For issues or questions: