Clone Issue failing due to Required Links validator

Issue #401 resolved
Former user created an issue

Hi,

When attempting to clone an issue within a project a validator i have on the create issue transition is failing. The only thing I can think of is that when cloning an issue, as well as cloning links, an additional 'is clone of' link type is created to the original issue and this is causing it to fail .. however I thought the configuration I have would ignore these types of links as they are not checked?

The intent of the configuration I have made is to require at least one (1) link to a 'Phase' issue type with the link type 'is a phase of project', all other link types should be ignored.

Please see attached screenshots

Comments (4)

  1. Fidel Castro Armario repo owner

    First of all, sorry for the delay in my response. I think that the problem is caused because of the fact that issue cloning is a two step process:

    1. The new issue (clone) is created with the same fields values as the original issue, but issue links are not yet cloned.
    2. Issue links are cloned once the clone has been actually created.

    The validator is evaluated in first step, and as the required issue links has not yet been created, it fails and prevents the step 1 to be terminated, and so the issue fails to be cloned.

    Try the following solution:

    Replace "Validation on linked issues" with "Boolean validator with math, date-time or text-string terms" with the following boolean expression:

    isAClone() OR count(filterByProject(filterByIssueType(linkedIssues("is a phase of project"), "Project"), %{00018})) = 1
    

    Note that:

    • %{00018} is field code for Project issue key
    • I have used = 1 since your validation message requires 1 and only 1 issue link with selected characteristics, but you can use > 0 if you prefer to allow more than 1.
  2. Fidel Castro Armario repo owner

    Hi Owen,

    If you are using JIRA 7.1 or higher there is a bug in function isAClone() that prevents the solution provided to work. I have fixed the problem in version 2.2.18_beta_5.

    I have also added a new parameter to all the validators in order to optionally disable the validator when an issue is being created by a cloning operation. With the new version you can use a configuration like this:

    cloning_validation_inhibitor.png

  3. Fidel Castro Armario repo owner

    Version 2.2.18 implementing the new parameter in the validations has been released. I close the issue. Please, reopen it if you need to.

  4. Log in to comment