glittershark / org-clubhouse

Simple, unopinionated integration between Emacs's org-mode and the Clubhouse issue tracker
MIT License
28 stars 13 forks source link

Bug - States only works for the main workflow #21

Open j-martin opened 4 years ago

j-martin commented 4 years ago

https://github.com/glittershark/org-clubhouse/pull/19 is a workaround the issue (before nothing would work).

Step to replicate:

  1. Create a new workflow in Clubhouse or change the org-clubhouse-workflow-name variable.
  2. Create a new story with that workflow. Note the story id.
  3. Eval org-clubhouse-headline-from-story-id (or any function that fetches stories) and pass the story id.

Result:

Without https://github.com/glittershark/org-clubhouse/pull/19: The function fails to run. With https://github.com/glittershark/org-clubhouse/pull/19: the heading gets created, but the state of the headline is UNKNOWN.

Expected:

The right state name is used regardless of the workflow used by the story.

A quick fix would be to flatten the list of states for all workflows instead of picking only the org-clubhouse-workflow-name in org-clubhouse-workflow-states, but what would make the state picker much less useful; too many states and most of these states would be rejected by the API since they may not belong to the project workflow.

BAM! Now handling this is a feature request and not a bug. :P

glittershark commented 4 years ago

Happy to accept PRs to fix this - ideally we'd just pick the workflow based on the project. I personally can't contribute much here since we only use a single workflow across all projects.

j-martin commented 4 years ago

I think if you set the org-clubhouse-workflow-name to something invalid you should be able to reproduce the issue. As far as I am concerned #19 is good enough for me.