https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292014-03-17T05:41:40ZRedmineRedmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=553762014-03-17T05:41:40ZTadashi Hirata
<ul></ul><p>Sorry, I sent it before I completed the description.</p>
<p>When you remove a check status_A/status_A crossing point in your<br />workflows, the workflows should prohibit to remain the status in<br />status_A when updating status_A issues. But because of this bug, the<br />current status always appears in selection lists, and workflows don't<br />work as you expected.</p>
<p>this one line patch is for the current trunk (<a class="changeset" title="remove garbage comment from test/integration/account_test.rb" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/12972">r12972</a>).</p>
<p>Please refer the recent discussion on <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: Force status transition on issue update (New)" href="https://www.redmine.org/issues/13560">#13560</a> also.</p>
<p>It would be good to provide db:migrate scripts in order to avoid <br />changing current projects' behavior.</p> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=556692014-04-03T06:34:15ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/13560">Feature #13560</a>: Force status transition on issue update</i> added</li></ul> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=556912014-04-03T15:54:39ZJose Juan Montes
<ul></ul><p>+1. Also, the patch works for me.</p> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=590122014-10-07T07:50:17ZAlexander Stehlik
<ul></ul><p>Thank you very much, works as expected.</p>
<p>Migration script seems to be a good idea though :)</p> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=604772014-12-19T22:55:13ZVD DV
<ul></ul><p>Please can you consider including this feature into 3.0 release? You might also make this feature optional by adding switch at global redmine settings (or individual project settings) that can be used to tun on or off this new feature (just in case you are considered how this feature would affect other redmine users).</p>
<p>Thank you</p> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=636302015-05-11T13:44:06ZAlexander Stehlik
<ul></ul><p>I just realized that there is a usability / validation issue, when the currently selected status is not allowed as new status.</p>
<p>The select field is rendered and does not contain the current status any more. But no value is selected by default which makes the browsers (Chrome / Firefox) render an empty option that is selected by default.</p>
<p>When the form is submitted with the empty option, the status does not change.</p>
<p>This indicates two problems:</p>
<ol>
<li>Usability problem: if the current status is not available in the list the first status should be selected by default</li>
<li>Validation problem: when the form is submitted and the current state is not allowed any more there should be an error.</li>
</ol> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=636392015-05-12T04:29:05ZTadashi Hirata
<ul></ul><p>Alexander Stehlik wrote:</p>
<blockquote>
<ol>
<li>Usability problem: if the current status is not available in the list the first status should be selected by default</li>
<li>Validation problem: when the form is submitted and the current state is not allowed any more there should be an error.</li>
</ol>
</blockquote>
<p>Aren't they problems of workflow definition? Not of redmine.</p> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=636682015-05-12T21:44:40ZAlexander Stehlik
<ul></ul><p>Well, both problems show up when you really want to force workflow transition.</p>
<p>With the current patch both issues will hit you, when you want to force a state change during saving.</p>
<p>To solve those problems two additions are needed for the patch to work nicely:</p>
<ul>
<li>if the current state is not allowed as next state, the first option in the state select needs to get the "selected" attribute</li>
<li>there needs to be a validation that makes sure that the submitted state is allowed as next state. So if the current state must be changed (forced transition) an empty state must not be an allowed value</li>
</ul> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=642232015-06-16T17:04:16ZAlexander Stehlik
<ul><li><strong>File</strong> <a href="/attachments/13798">workflow_bugfix-master-2015-06-16.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/13798/workflow_bugfix-master-2015-06-16.diff">workflow_bugfix-master-2015-06-16.diff</a> added</li></ul><p>The attached patch should solve the usability issues.</p> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=754742016-12-30T08:04:41ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/5593">Defect #5593</a>: Grey out workflow checkboxes for transitions to the same status</i> added</li></ul> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=781952017-04-25T14:12:20ZOlivier Houdas
<ul></ul><p>I faced the same issue and I'm happy to find a fix here.<br />Is there any reason why this is not applied to the code of Redmine? Unchecking the transition status_A -> Status_A and still having it available in the issue edit status lists looks like a bug to me.</p>
<p>Note that <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: Reply to closed ticket changes status to "reopen" designated status (New)" href="https://www.redmine.org/issues/15837">#15837</a> and <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: change automatically the status A to B (and the assignee) when an user add a note (New)" href="https://www.redmine.org/issues/22280">#22280</a> would benefit from this fix as well (it's all about forcing transitions).</p> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=787752017-05-25T07:19:44ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/15837">Feature #15837</a>: Reply to closed ticket changes status to "reopen" designated status</i> added</li></ul> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=787772017-05-25T07:20:00ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/22280">Feature #22280</a>: change automatically the status A to B (and the assignee) when an user add a note</i> added</li></ul> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=801202017-07-19T11:54:57ZOlivier Houdas
<ul></ul><p>I have tested this patch and I do not agree with one of the changes in the patch:<br />From<br /> statuses << initial_status if statuses.empty?<br />to<br /> statuses << initial_status unless statuses.empty?</p>
<p>This is a bug and should be deleted from the patch. It makes it impossible to remain on a given status even though the checkbox in the workflow is checked to allow leaving a status unchanged.</p>
<p>What we want is <strong>not</strong> <em>to force changes of status</em>, <strong>nor</strong> <em>to always allow remaining on the existing status</em>: what we want is to follow the choices made in the Workflow management screen.</p> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=819022017-11-03T21:35:12ZStéphane Lavergne
<ul></ul><p>Olivier Houdas wrote:</p>
<blockquote>
<p>I have tested this patch and I do not agree with one of the changes in the patch:<br />From<br />statuses << initial_status if statuses.empty?<br />to<br />statuses << initial_status unless statuses.empty?</p>
<p>This is a bug and should be deleted from the patch.</p>
</blockquote>
<p>Actually the patch is <code>-unless</code> <code>+if</code> from what I can tell, and that's what I needed here to get the behavior which my workflow prescribes.</p>
<p>What surprised me, however, was that inbound e-mails for existing issues with a non-New status started bouncing with:</p>
<blockquote>
<p>MailHandler: Validation failed: Statut n'est pas valide</p>
</blockquote>
<p>I had to do 2 things to finalize my implementation of mandatory status changes:</p>
<p>First, I excluded the <code>errors.add :status_id</code> portion from the patch, so that e-mails stopped bouncing.</p>
<p>Second, and this is surprising, but our Redmine 3.4.2 completely ignored <code>--status</code> arguments to the mail handler command in our aliases file. I commented out line 240 of <code>app/models/mail_handler.rb</code> to solve that. It looks like it should've been put in <code>receive_issue()</code> and not here in <code>receive_issue_reply()</code>, but I don't speak Ruby so this is as far as I dared go:</p>
<blockquote>
<p><code># ignore CLI-supplied defaults for new issues</code><br /><code>#handler_options[:issue].clear</code></p>
</blockquote>
<p>I hope this helps others who may run into the same dead-end I was in. :)</p> Redmine - Patch #16364: Issue workflow doesn't force status transition though workflow is defined sohttps://www.redmine.org/issues/16364?journal_id=848362018-05-04T14:12:40ZOlivier Houdas
<ul></ul><p>You're right, I inverted the order of the change in my comment.</p>
<p>This does not change the fact that the diagonal line of the workflow (status X -> Status X) has checkboxes which have no effect, and it is a bug.</p>