Validation on Linked Issue Bug

Issue #166 resolved
Jeremie Sintec created an issue

Hi, I run JIRA v6.4.3 with JIRA Workflow Toolbox v2.1.33.

In my instance, I have 2 projects that share the same workflow, the same screen schemes, field schemes, permission schemes... almost everything is exactly the same.

I have a transition (Duplicate) which enforces the creation of a link of type duplicates from the transitioning issue to another one (chosen from the dedicated combobox). I created the transition with a Validation on Linked Issue (see attached).

In one project, it works like a charm. In the other, it throws the Message to show when validation fails every time (without a stacktrace to show for it) and won't conclude the transition.

Any help would be greatly appreciated.

Comments (12)

  1. Fidel Castro Armario repo owner

    He Jeremie,

    Two observations about your configuration:

    1. You are not enforcing creation of a link of type duplicates, since parameter "Minimum required number of issue links" is set to zero. You should set this parameter to 1.
    2. Your are forbidding issue link types different from "duplicates". I think that you don't want that behavior. You should check parameter Allow unselected issue link types.

    Please, let me know if those changes solve your problem.

    Regards,

    Fidel

  2. Jeremie Sintec reporter

    Hi, and thanks for your quick answer.

    Checking the Allow unselected issue link types does indeed resolve the issue, the only problem is, I don't want to allow users to choose another type of link. Since I can't remove values from the Linked Issues field set in the transition screen, allowing only duplicates link seems to be the only way to do so.

    Also, the configuration I sent you works fine on another project (sharing the same workflow, permissions...).

    So yes, it works, but it also opens a gateway to unwanted behavior (setting any link type).

    PS: I implemented your first suggestion, it doesn't resolve the bug but it should indeed be 1 and not 0. Thanks for the pointer !

  3. Fidel Castro Armario repo owner

    Hi Jeremie,

    "Validator on linked issues" checks all the issue links of the issue. If you want to check only those issue links added in transition screen, use "Boolean validator with math, date-time or text-string terms" with the following configuration:

    conf-1.png

    Boolean expression used is:

    count(transitionLinkedIssues("")) > 1 AND count(filterByProject(filterByIssueType(transitionLinkedIssues("duplicates"), "Improvement, Bug, Change Request, Feature, Story, Epic"), %{00018})) = count(transitionLinkedIssues(""))
    

    Note that %{00018} is field code for "Project key".

    Regards,

    Fidel

  4. Jeremie Sintec reporter

    Thanks, it seems to work fine.

    Since I allowed unselected issue types in the previous configuration, shouldn't it be ?

    count(transitionLinkedIssues("")) > 1 AND count(filterByProject(transitionLinkedIssues("duplicates"), %{00018})) = count(transitionLinkedIssues(""))
    
  5. Fidel Castro Armario repo owner

    The expression you propose is satisfied by a link "duplicates" with any issue type, even in different from "Improvement", "Bug", "Change Request", "Feature", "Story" and "Epic". That is not equivalent to your original configuration of "Validation on linked issues".

    An expression exactly equivalent is:

    count(transitionLinkedIssues("")) = count(transitionLinkedIssues("duplicates")) AND count(filterByProject(filterByIssueType(transitionLinkedIssues("duplicates"), "Improvement, Bug, Change Request, Feature, Story, Epic"), %{00018})) > 1
    
  6. Jeremie Sintec reporter

    even though I had allow unselected issue types checked in the previous configuration ?

  7. Fidel Castro Armario repo owner

    Yes. Your previous configuration requires at least one issue link "duplicates" with an issue type "Improvement", "Bug", "Change Request", "Feature", "Story" or "Epic", but you also allow issue link "duplicates" with other issue types. Issue link "duplicates with other issue types are no counted. On the other hand, issue link types different from "duplicates" are not allowed.

    Anyway, I think that perhaps you also want to allow other issue link types. In that case you should use:

    count(filterByProject(filterByIssueType(transitionLinkedIssues("duplicates"), "Improvement, Bug, Change Request, Feature, Story, Epic"), %{00018})) > 1
    
  8. Jeremie Sintec reporter

    Old configuration aside, I just want a validation on this transition that will validate:

    1 or more links of type duplicates between issues belonging to the same project are created (regardless of the linked issue type).

    This seem to work:

    count(transitionLinkedIssues("")) = count(transitionLinkedIssues("duplicates")) AND
    count(transitionLinkedIssues("")) = count(filterByProject(transitionLinkedIssues(""), %{00018})) AND
    count(transitionLinkedIssues("")) >= 1
    

    Would you mind reviewing this expression ? Thank you !

  9. Fidel Castro Armario repo owner

    The expression works, but this one is more efficient, taken into account that in transition screen you can only use 1 issue link type:

    count(transitionLinkedIssues("")) > 0 AND
    count(transitionLinkedIssues("")) = count(filterByProject(transitionLinkedIssues("duplicates"), %{00018}))
    
  10. Jeremie Sintec reporter

    Thanks again. It's always reassuring to know that support is present and active. It shows great involvement and dedication so Thumbs Up and keep up the Great work !

  11. Log in to comment