No issue created when issue cloned and link issue validation defined

Issue #122 resolved
Thorsten Kiefer created an issue

Hi Fidel,

I found a bug in the combination of the Workflow Toolbox and the standard clone functionality in JIRA.

Following situation: We have a validation for an issuetype in the create issue step that there must be a is child of link to another issue of defined issuetypes (Validation on linked issues). This works: The user is only able to create the issue of the issue is linked to another issue like defined in the validation rule.

But if you now want to clone this issue (JIRA standard clone functionality) then no new issue will be created and the clone link is set to the issue itself (even if the links are cloned too; see screenshots).

Is this an error or do you have a hint to use a postfunction that first collects the link and then creates the new issue?

We use JIRA 6.3.8/6.3.12 and Workflow Toolbox 2.1.30

Best Regards Thorsten Kiefer

Comments (8)

  1. Fidel Castro Armario repo owner

    Can you please provide a screenshot with the configuration of the validator used in "Create Issue" transition?

  2. Fidel Castro Armario repo owner

    While I investigate the problem, you can implement an equivalent validation which doesn't have this problem using "Boolean validator with math, date-time or text-string terms" with the following boolean expression:

    isAClone() OR count(linkedIssues()) > 1 AND count(filterByResolution(filterByStatus(filterByIssueType(linkedIssues("is Child of"), "New Feature, Internal Requests"), "In Analysis, Ready for Development, Clarify, In Progress, Open"), "")) = count(linkedIssues())

    I also provide you another expression that fits better your validation message, since it keeps requiring at least one child to unresolved issues of selected issue types and statuses, but also allows other issue links:

    isAClone() OR count(filterByResolution(filterByStatus(filterByIssueType(linkedIssues("is Child of"), "New Feature, Internal Requests"), "In Analysis, Ready for Development, Clarify, In Progress, Open"), "")) > 1

  3. Thorsten Kiefer reporter

    It does not work completely. I changed >1 to >=1 because otherwise it was not possible to create an issue of type Task. With the change it was possible. The cloning also works if you clone the links, too. But there is the option to clone the issue without links. So it is possible to create a Task issue without relation to New Feature, Internal Requests. This is not possible for the normal creation process because of the validation. I enhanced the function in the first part isAClone() to

    (isAClone() AND count(filterByResolution(filterByStatus(filterByIssueType(linkedIssues("is Child of"), "New Feature, Internal Requests"), "In Analysis, Ready for Development, Clarify, In Progress, Open"), "")) >= 1 ) OR count(filterByResolution(filterByStatus(filterByIssueType(linkedIssues("is Child of"), "New Feature, Internal Requests"), "In Analysis, Ready for Development, Clarify, In Progress, Open"), "")) >= 1

    But in this case the same effect occured as before: No new issue is created and the issue is linked to itself. Is there any possibilty for both validations so that there is no possibility to clone Task issues without the necessary link?

  4. Fidel Castro Armario repo owner

    Hi Thorsten,

    Problem of self-referencing "clones" issue link is due to a bug of JIRA, that was fixed in version 6.3.13 (see JRA-29704). Once you upgrade to this version, the validator will prevent issue clonation, showing the user your customized message.

    Anyway, you will keep having the problem of not being able to clone the issue. The cause seems to be that issue clonation and issue link clonation seems to be two different operations that are carried one after the other one, and since the validator is executed at issue creation, it fails since issue links are not yet cloned at that moment.

    I have thought a possible solution based on a virtual field called "Import issue links from another issue", that will be able to copy issue links from one issue into another one, but I need to work on it.

    At this moment, the only solution I can give you is boolean validation:

    isAClone() OR count(linkedIssues()) > 1 AND count(filterByResolution(filterByStatus(filterByIssueType(linkedIssues("is Child of"), "New Feature, Internal Requests"), "In Analysis, Ready for Development, Clarify, In Progress, Open"), "")) = count(linkedIssues())

    As a workaround you can add additional "Validation on linked issues" in other transitions of the workflow, in order to detect whether the issue has been cloned without issue links.

  5. Fidel Castro Armario repo owner

    Hi Thorsten, I have included a post-function called "Clone issue links" in version 2.1.31_beta_10.

    This post-function imports issue links from cloned issue in case they haven't been cloned too. When added to "Create Issue" transition, this post-function ensures that issue links will always be cloned, even if the user forgets to check "Clone Links".

  6. Fidel Castro Armario repo owner

    I close the issue. Please, reopen it if you need extra support on this issue.

  7. Log in to comment