Skip to content

linear: map issue priority onto taskwarrior priority#1198

Merged
ryneeverett merged 3 commits intoGothenburgBitFactory:developfrom
lxcode:fix/linear-priority
Apr 10, 2026
Merged

linear: map issue priority onto taskwarrior priority#1198
ryneeverett merged 3 commits intoGothenburgBitFactory:developfrom
lxcode:fix/linear-priority

Conversation

@lxcode
Copy link
Copy Markdown
Contributor

@lxcode lxcode commented Apr 8, 2026

Linear's GraphQL exposes a per-issue priority integer (0=No priority, 1=Urgent, 2=High, 3=Medium, 4=Low) that wasn't being queried, so every imported task got the service-wide default_priority. Add the field to the issues query and translate it onto taskwarrior's H/M/L buckets, falling back to default_priority for "No priority".

Linear's GraphQL exposes a per-issue priority integer (0=No priority,
1=Urgent, 2=High, 3=Medium, 4=Low) that wasn't being queried, so every
imported task got the service-wide default_priority. Add the field to
the issues query and translate it onto taskwarrior's H/M/L buckets,
falling back to default_priority for "No priority".
@lxcode lxcode force-pushed the fix/linear-priority branch from 7b3953e to 2715883 Compare April 8, 2026 11:52
lxcode and others added 2 commits April 9, 2026 02:22
Co-authored-by: ryneeverett <ryneeverett@gmail.com>
@ryneeverett ryneeverett requested a review from djmitche April 9, 2026 12:48
Copy link
Copy Markdown
Collaborator

@djmitche djmitche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies if I've forgotten some magic here, but I don't see get_priority defined.

It seems the 0 priority from linear should map to the BW default priority, rather than always being H. The tests suggest that is the case but I can't see where that's implemented.

BTW as a daily user of the linear integration I'm looking forward to this. It's been at the end of my +rainyday tasks for a long time.

@ryneeverett
Copy link
Copy Markdown
Collaborator

Apologies if I've forgotten some magic here, but I don't see get_priority defined.

It is inherited.

def get_priority(self) -> typing.Literal['', 'L', 'M', 'H']:
"""Return the priority of this issue, falling back to ``default_priority`` configuration."""
return self.PRIORITY_MAP.get(
self.record.get('priority'), self.config.default_priority
)

It seems the 0 priority from linear should map to the BW default priority, rather than always being H. The tests suggest that is the case but I can't see where that's implemented.

Since 0 isn't in PRIORITY_MAP, get_priority will return the default value.

Copy link
Copy Markdown
Collaborator

@djmitche djmitche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, got it. Thanks!

@ryneeverett ryneeverett merged commit 52ef99a into GothenburgBitFactory:develop Apr 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants