diff --git a/bugwarrior/services/linear.py b/bugwarrior/services/linear.py index 6f37f44f..fc1eae72 100644 --- a/bugwarrior/services/linear.py +++ b/bugwarrior/services/linear.py @@ -73,6 +73,7 @@ def to_taskwarrior(self): created = self.parse_date(self.record.get("createdAt")) modified = self.parse_date(self.record.get("updatedAt")) closed = self.parse_date(self.record.get("completedAt")) + due = self.parse_date(self.record.get("dueDate")) # Get a value, defaulting empty results to the given default. Some # GraphQL response values, such as for `project`, are either an object @@ -94,6 +95,7 @@ def get(v, k, default=None): or None ), "priority": self.get_priority(), + "due": due, "entry": created, "annotations": get(self.extra, "annotations", []), "tags": self.get_tags(), @@ -169,6 +171,7 @@ def __init__(self, *args, **kwargs): completedAt updatedAt createdAt + dueDate project { name } diff --git a/tests/test_linear.py b/tests/test_linear.py index 0d7f02b2..c183caa2 100644 --- a/tests/test_linear.py +++ b/tests/test_linear.py @@ -51,6 +51,7 @@ "completedAt": null, "updatedAt": "2025-07-24T17:08:33.286Z", "createdAt": "2025-07-24T15:34:07.968Z", + "dueDate": "2025-08-22", "project": null, "labels": { "nodes": [ @@ -146,6 +147,7 @@ def test_to_taskwarrior(self): expected_output = { "project": "prj", "priority": "L", + "due": None, "entry": created_timestamp, "annotations": [], "tags": [], @@ -170,9 +172,11 @@ def test_to_taskwarrior(self): created_timestamp = datetime(2025, 7, 24, 15, 34, 7, 0, tzinfo=timezone.utc) updated_timestamp = datetime(2025, 7, 24, 17, 8, 33, 0, tzinfo=timezone.utc) + due_timestamp = datetime(2025, 8, 22, 0, 0, 0, 0, tzinfo=timezone.utc) expected_output = { "project": None, "priority": "H", + "due": due_timestamp, "entry": created_timestamp, "annotations": [], "tags": ["Improvement", "Feature"], @@ -202,6 +206,7 @@ def test_issues(self): "annotations": [], "description": "(bw)#DUS-5 - DO STUFF .. " "https://linear.app/dustins-doings/issue/DUS-5/do-stuff", + "due": None, "entry": created_timestamp, "linearassignee": "djmitche@gmail.com", "linearclosed": closed_timestamp,