Skip to content

Fix: pass when no CF value is selectable for a CF depending on another CF's value#2

Open
brunetton wants to merge 1 commit into
bestpractical:masterfrom
Easter-eggs:master
Open

Fix: pass when no CF value is selectable for a CF depending on another CF's value#2
brunetton wants to merge 1 commit into
bestpractical:masterfrom
Easter-eggs:master

Conversation

@brunetton
Copy link
Copy Markdown

Hi

This PR fixes a case we had to handle in one of our client's RT instance.
First of all, I'm sorry not to have written tests for this particular case; I'm don't feel yet comfortable enough to write tests for RT.

The problem fixed here appears when a CF that values depends on another CF's values have no selectable value.
The plugin block from validating transition, requireing a value for the CF that do not exists.

Steps to reproduce problem

  • define a CF named cf1 with values:

    • value 1
    • value 2
  • define another CF named cf2 with only one value, based on cf1 value:

    • cf1 -> value 1 => cf2 -> value 1
  • define rules for MandatoryOnTransition plugin that implies both cf1 and cf2:

    Plugin('RT::Extension::MandatoryOnTransition');
    Set(%MandatoryOnTransition,
       'MandatoryOnTransitionTest' => {
           '* -> resolved' => ['CF.cf1', 'CF.cf2'],
           '* -> open' => ['CF.cf1', 'CF.cf2'],
       }
    );
    
  • change status of a test ticket, selecting value 2 for cf1

    • => no values are presented for cf2, as there is no possible values for this CF in that case
  • try to validate page => MandatoryOnTransition blocks from validating, saying that a value must be selected for cf2

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.

1 participant