Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brunetton
Copy link

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