#1541  Issue transitions problems
Closed
jbauer opened 8 months ago

Hi,

I am using OneDev 9.1.2 and having some trouble defining some new issue transitions.

Currently I have issue states (among others):

  • Ready to implement
  • In development
  • Committed

Then I have defined a new asymmetric, multi-valued issue link named Task with other side named Parent and disallowed multiple parents. Also the issue link only allows issues to be linked with "Type" is "Task". The backlink from task to parent does not have that restriction because the top level issue might be a feature issues or similar. The idea is that an issue can be broken down into smaller tasks and each can be referenced in a commit.

Then I created a following issue hierarchy with all issues being in state Ready to implement:

  • Feature issue
    • Task 1
      • Task 1.1
    • Task 2

Now I want:

  • transition Feature issue from Ready to implement to In development as soon as any task changes to in development. To do so I used the corresponding issue transition with issue query any "Task" matching(current issue). This works. If I change Task 1.1 to in development via batch edit the whole chain up to Feature issue changes automatically as well.
  • transition Feature issue from in development to committed once all tasks are committed. To do so I used a transition with query any "Task" matching(current issue) and all "Task" matching("State" is "Committed"). However this does not work for some reason. I am using batch edit to manually modify the state of tasks one-by-one to state committed but the feature issue does not transition automatically once all tasks are in state committed. Once I manually put all task issues into state committed I can use the query in the issue list search and replace current issue with "Number" is "#3" (assuming that Task 1.1 has number 3 for example) and the query returns the feature issue. So I assume that the query is correct and the feature issue should have transitioned.

Any idea? It is weird that other issue transitions work.

jbauer commented 8 months ago

Oh and the query written as any "Task" matching(current issue) and not (any "Task" matching("State" is "In development")) doesn't work either. That is basically the query you used in your guide at https://docs.onedev.io/tutorials/issue/issue-links . It is semantically a little different to what I want so I changed it to ... and all "Task" matching("State" is "Committed")

Robin Shen commented 8 months ago

Batch edit let you set state and custom field to arbitrary value, but will never trigger issue transition rules, for performance reason and also in order not to cause undesired side effects. It should only treated as a last resort to "fix" something abnormal.

For your case, please configure appropriate transition rule to allow tasks being committed manually or automatically. Then its parent will be turn into committed automatically once all tasks are committed.

jbauer commented 8 months ago

Thanks for your answer. I temporarily added a button to change state to committed and transitions work as expected. Maybe adding a little note below the headline in the batch edit wizard might make sense.

jbauer changed state to 'Closed' 8 months ago
Previous Value Current Value
Open
Closed
Robin Shen commented 8 months ago

Maybe adding a little note below the headline in the batch edit wizard might make sense.

Will do that

issue 1 of 1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
onedev/server#1541
Please wait...
Page is in error, reload to recover