Thanks for clarifying
issue.parent would be
undefined for issues that don’t have a parent issue. We haven’t really been able to use it the way you suggested to inhibit the creation of sub-tasks. Here are the attempts we made:
- key: example-no-sub-tasks
name: No Sub-tasks
description: Sub-tasks should never be created.
expression: issue.parent || true
errorMessage: "Please display this..."
- key: example-no-sub-tasks-two
name: No Sub-tasks 2
description: Sub-tasks should never be created 2, electric boogaloo.
expression: (typeof issue.parent) == 'undefined'
errorMessage: "Please, let this be displayed"
Neither of these worked the way we expected them to, and none of them displayed the error message configured in the manifest. However, comparing
null did allow us to make a validator that allowed only non-child issues to be created.
Regardless, we weren’t able to display the
errorMessage and continue to get the same default error message shown in the picture @VinciusTrainotti attached to the first message in this thread.
This validator should circumvent any possibilities of the Jira expression not resolving to a Boolean type value, and can be used to show the
errorMessage isn’t being displayed, however:
- key: example-no-non-bugs
name: Only Bugs
description: Only bugs can be created
expression: issue.issueType.name == "Bug"
errorMessage: "You can create only bugs!"
With this validator in the Create transition, issues of type Bug can be created without errors, but issues of any other types still show the same error message: