0
# Project Management
1
2
Full project lifecycle management including creation, updates, member management, and relationship tracking with milestones, updates, and documentation.
3
4
## Capabilities
5
6
### Core Project Operations
7
8
Basic project management operations for creating, reading, updating, and deleting projects.
9
10
```python { .api }
11
def get(self, project_id: str) -> LinearProject:
12
"""
13
Fetch a project by ID with comprehensive details including status, dates,
14
relationships, and document content.
15
16
Args:
17
project_id: The ID of the project to fetch
18
19
Returns:
20
LinearProject with complete details
21
22
Raises:
23
ValueError: If project not found
24
"""
25
26
def create(self, name: str, team_name: str, description: Optional[str] = None) -> LinearProject:
27
"""
28
Create a new project in Linear for a specific team with optional description.
29
30
Args:
31
name: Project name
32
team_name: Name of the team that owns the project
33
description: Optional project description
34
35
Returns:
36
Created LinearProject object
37
38
Raises:
39
ValueError: If creation fails
40
"""
41
42
def update(self, project_id: str, **kwargs) -> LinearProject:
43
"""
44
Update an existing project with flexible field updates.
45
46
Args:
47
project_id: The ID of the project to update
48
**kwargs: Fields to update (name, description, status, etc.)
49
50
Returns:
51
Updated LinearProject object
52
53
Raises:
54
ValueError: If update fails
55
"""
56
57
def delete(self, project_id: str) -> bool:
58
"""
59
Delete a project by its ID.
60
61
Args:
62
project_id: The ID of the project to delete
63
64
Returns:
65
True if successful
66
67
Raises:
68
ValueError: If deletion fails
69
"""
70
```
71
72
Usage examples:
73
74
```python
75
from linear_api import LinearClient
76
77
client = LinearClient()
78
79
# Get a project
80
project = client.projects.get("project-id")
81
print(f"Project: {project.name} ({project.status.type})")
82
83
# Create a new project
84
new_project = client.projects.create(
85
name="Q4 Feature Development",
86
team_name="Engineering",
87
description="Major feature development for Q4 release"
88
)
89
90
# Update project status
91
updated = client.projects.update(
92
project.id,
93
description="Updated project description",
94
status="STARTED"
95
)
96
97
# Delete a project
98
success = client.projects.delete("project-id")
99
```
100
101
### Project Discovery
102
103
Find and query projects by various criteria.
104
105
```python { .api }
106
def get_all(self, team_id: Optional[str] = None) -> Dict[str, LinearProject]:
107
"""
108
Get all projects, optionally filtered by team.
109
110
Args:
111
team_id: Optional team ID to filter projects
112
113
Returns:
114
Dictionary mapping project IDs to LinearProject objects
115
"""
116
117
def get_id_by_name(self, project_name: str, team_id: Optional[str] = None) -> str:
118
"""
119
Get a project ID by its name, optionally within a specific team.
120
121
Args:
122
project_name: Name of the project to find
123
team_id: Optional team ID to narrow search
124
125
Returns:
126
Project ID string
127
128
Raises:
129
ValueError: If project not found
130
"""
131
```
132
133
Usage examples:
134
135
```python
136
# Get all projects
137
all_projects = client.projects.get_all()
138
print(f"Found {len(all_projects)} projects")
139
140
# Get projects for specific team
141
team_projects = client.projects.get_all(team_id="team-id")
142
143
# Find project by name
144
project_id = client.projects.get_id_by_name("Q4 Feature Development")
145
project = client.projects.get(project_id)
146
```
147
148
### Member Management
149
150
Manage project team membership and access.
151
152
```python { .api }
153
def get_members(self, project_id: str) -> List[LinearUser]:
154
"""
155
Get members of a project with automatic pagination and LinearUser model conversion.
156
157
Args:
158
project_id: The ID of the project
159
160
Returns:
161
List of LinearUser objects
162
"""
163
```
164
165
Usage examples:
166
167
```python
168
# Get project members
169
members = client.projects.get_members("project-id")
170
print(f"Project has {len(members)} members:")
171
for member in members:
172
print(f" - {member.name} ({member.email})")
173
```
174
175
### Milestone Tracking
176
177
Manage project milestones and timeline tracking.
178
179
```python { .api }
180
def get_milestones(self, project_id: str) -> List[ProjectMilestone]:
181
"""
182
Get milestones for a project with automatic model conversion.
183
184
Args:
185
project_id: The ID of the project
186
187
Returns:
188
List of ProjectMilestone objects
189
"""
190
```
191
192
Usage examples:
193
194
```python
195
# Get project milestones
196
milestones = client.projects.get_milestones("project-id")
197
for milestone in milestones:
198
print(f"Milestone: {milestone.name}")
199
```
200
201
### Project Communication
202
203
Access project comments and communication history.
204
205
```python { .api }
206
def get_comments(self, project_id: str) -> List[Comment]:
207
"""
208
Get comments for a project with automatic pagination and Comment model conversion.
209
210
Args:
211
project_id: The ID of the project
212
213
Returns:
214
List of Comment objects
215
"""
216
```
217
218
Usage examples:
219
220
```python
221
# Get project comments
222
comments = client.projects.get_comments("project-id")
223
print(f"Project has {len(comments)} comments")
224
for comment in comments:
225
print(f"Comment by {comment.creator.name}: {comment.body[:50]}...")
226
```
227
228
### Issue Integration
229
230
Access issues associated with projects.
231
232
```python { .api }
233
def get_issues(self, project_id: str) -> List[LinearIssue]:
234
"""
235
Get issues for a project with basic issue information.
236
237
Args:
238
project_id: The ID of the project
239
240
Returns:
241
List of LinearIssue objects
242
"""
243
```
244
245
Usage examples:
246
247
```python
248
# Get project issues
249
issues = client.projects.get_issues("project-id")
250
print(f"Project has {len(issues)} issues")
251
252
# Group by status
253
from collections import defaultdict
254
by_status = defaultdict(list)
255
for issue in issues:
256
by_status[issue.state.name].append(issue)
257
258
for status, issue_list in by_status.items():
259
print(f"{status}: {len(issue_list)} issues")
260
```
261
262
### Project Updates
263
264
Track project progress updates and status changes.
265
266
```python { .api }
267
def get_project_updates(self, project_id: str) -> List[ProjectUpdate]:
268
"""
269
Get updates for a project with automatic model conversion.
270
271
Args:
272
project_id: The ID of the project
273
274
Returns:
275
List of ProjectUpdate objects
276
"""
277
```
278
279
Usage examples:
280
281
```python
282
# Get project updates
283
updates = client.projects.get_project_updates("project-id")
284
for update in updates:
285
print(f"Update: {update.id}")
286
```
287
288
### Project Relationships
289
290
Manage project relationships and dependencies.
291
292
```python { .api }
293
def get_relations(self, project_id: str) -> List[ProjectRelation]:
294
"""
295
Get relations for a project including related projects and relationship types.
296
297
Args:
298
project_id: The ID of the project
299
300
Returns:
301
List of ProjectRelation objects
302
"""
303
```
304
305
Usage examples:
306
307
```python
308
# Get project relations
309
relations = client.projects.get_relations("project-id")
310
for relation in relations:
311
print(f"Relation: {relation.type}")
312
```
313
314
### Team Integration
315
316
Access teams associated with projects.
317
318
```python { .api }
319
def get_teams(self, project_id: str) -> List[LinearTeam]:
320
"""
321
Get teams associated with a project.
322
323
Args:
324
project_id: The ID of the project
325
326
Returns:
327
List of LinearTeam objects
328
"""
329
```
330
331
Usage examples:
332
333
```python
334
# Get project teams
335
teams = client.projects.get_teams("project-id")
336
for team in teams:
337
print(f"Team: {team.name}")
338
```
339
340
### Documentation Management
341
342
Access project documentation and external resources.
343
344
```python { .api }
345
def get_documents(self, project_id: str) -> List[Document]:
346
"""
347
Get documents associated with a project.
348
349
Args:
350
project_id: The ID of the project
351
352
Returns:
353
List of Document objects
354
"""
355
356
def get_external_links(self, project_id: str) -> List[EntityExternalLink]:
357
"""
358
Get external links associated with a project.
359
360
Args:
361
project_id: The ID of the project
362
363
Returns:
364
List of EntityExternalLink objects
365
"""
366
```
367
368
Usage examples:
369
370
```python
371
# Get project documents
372
documents = client.projects.get_documents("project-id")
373
for doc in documents:
374
print(f"Document: {doc.title}")
375
376
# Get external links
377
links = client.projects.get_external_links("project-id")
378
for link in links:
379
print(f"Link: {link.label} - {link.url}")
380
```
381
382
### Project History
383
384
Track project change history and audit trail.
385
386
```python { .api }
387
def get_history(self, project_id: str) -> List[ProjectHistory]:
388
"""
389
Get the history of a project with change entries.
390
391
Args:
392
project_id: The ID of the project
393
394
Returns:
395
List of ProjectHistory objects
396
"""
397
```
398
399
Usage examples:
400
401
```python
402
# Get project history
403
history = client.projects.get_history("project-id")
404
for entry in history:
405
print(f"History: {entry.id} at {entry.createdAt}")
406
```
407
408
### Initiative Integration
409
410
Access initiatives associated with projects for strategic planning.
411
412
```python { .api }
413
def get_initiatives(self, project_id: str) -> List[Dict[str, Any]]:
414
"""
415
Get initiatives associated with a project.
416
417
Args:
418
project_id: The ID of the project
419
420
Returns:
421
List of initiative dictionaries
422
"""
423
```
424
425
Usage examples:
426
427
```python
428
# Get project initiatives
429
initiatives = client.projects.get_initiatives("project-id")
430
for initiative in initiatives:
431
print(f"Initiative: {initiative.get('name')}")
432
```
433
434
### Label Management
435
436
Access project labels for categorization and organization.
437
438
```python { .api }
439
def get_labels(self, project_id: str) -> List[LinearLabel]:
440
"""
441
Get labels associated with a project.
442
443
Args:
444
project_id: The ID of the project
445
446
Returns:
447
List of LinearLabel objects
448
"""
449
```
450
451
Usage examples:
452
453
```python
454
# Get project labels
455
labels = client.projects.get_labels("project-id")
456
for label in labels:
457
print(f"Label: {label.name} ({label.color})")
458
```
459
460
### Customer Needs Integration
461
462
Access customer needs associated with projects for product management.
463
464
```python { .api }
465
def get_needs(self, project_id: str) -> List[CustomerNeed]:
466
"""
467
Get customer needs associated with a project.
468
469
Args:
470
project_id: The ID of the project
471
472
Returns:
473
List of CustomerNeed objects
474
"""
475
```
476
477
Usage examples:
478
479
```python
480
# Get customer needs
481
needs = client.projects.get_needs("project-id")
482
for need in needs:
483
print(f"Customer need: {need.id}")
484
```
485
486
### Cache Management
487
488
Control caching for project-related data.
489
490
```python { .api }
491
def invalidate_cache(self) -> None:
492
"""
493
Invalidate all project-related caches.
494
"""
495
```
496
497
Usage examples:
498
499
```python
500
# Clear project caches
501
client.projects.invalidate_cache()
502
```
503
504
## Project Status Management
505
506
Projects in Linear have specific status types that control their lifecycle:
507
508
```python
509
from linear_api import ProjectStatusType
510
511
# Available status types
512
statuses = [
513
ProjectStatusType.PLANNED, # Planning phase
514
ProjectStatusType.BACKLOG, # In backlog
515
ProjectStatusType.STARTED, # Active development
516
ProjectStatusType.PAUSED, # Temporarily paused
517
ProjectStatusType.COMPLETED, # Successfully completed
518
ProjectStatusType.CANCELED # Cancelled
519
]
520
521
# Update project status
522
client.projects.update("project-id", status=ProjectStatusType.STARTED)
523
```
524
525
## Advanced Project Workflows
526
527
### Project Creation with Full Configuration
528
529
```python
530
# Create a comprehensive project
531
project = client.projects.create(
532
name="Mobile App Redesign",
533
team_name="Design",
534
description="Complete redesign of mobile application UI/UX"
535
)
536
537
# Add initial configuration
538
client.projects.update(project.id,
539
status=ProjectStatusType.STARTED,
540
priority=1, # High priority
541
targetDate="2024-12-31"
542
)
543
```
544
545
### Project Status Reporting
546
547
```python
548
def generate_project_report(project_id: str):
549
project = client.projects.get(project_id)
550
issues = client.projects.get_issues(project_id)
551
members = client.projects.get_members(project_id)
552
553
# Calculate completion metrics
554
completed_issues = [i for i in issues if i.state.type == "completed"]
555
completion_rate = len(completed_issues) / len(issues) if issues else 0
556
557
print(f"Project: {project.name}")
558
print(f"Status: {project.status.type}")
559
print(f"Progress: {project.progress}%")
560
print(f"Issues: {len(completed_issues)}/{len(issues)} completed ({completion_rate:.1%})")
561
print(f"Team: {len(members)} members")
562
563
return {
564
"project": project,
565
"completion_rate": completion_rate,
566
"total_issues": len(issues),
567
"completed_issues": len(completed_issues),
568
"team_size": len(members)
569
}
570
571
# Generate report
572
report = generate_project_report("project-id")
573
```
574
575
### Cross-Project Analysis
576
577
```python
578
def analyze_team_projects(team_name: str):
579
# Get team ID
580
team_id = client.teams.get_id_by_name(team_name)
581
582
# Get all projects for team
583
projects = client.projects.get_all(team_id=team_id)
584
585
# Analyze by status
586
status_counts = {}
587
for project in projects.values():
588
status = project.status.type
589
status_counts[status] = status_counts.get(status, 0) + 1
590
591
print(f"Team {team_name} project status distribution:")
592
for status, count in status_counts.items():
593
print(f" {status}: {count} projects")
594
595
return status_counts
596
597
# Analyze team projects
598
analysis = analyze_team_projects("Engineering")
599
```