Hello community,
In my topic, I want to configure the system so that it’s not possible to set an open task to the status "Done" or "Canceled" if there are still open subtasks.
I know that under the "Triggers" section, you can set the transition to "All subtasks must be done," but here’s the actual problem:
I don’t want the "Done" button to disappear. Instead, I want it to remain visible, and when I click it, there should be a message like "Check open subtasks," for example.
How can I set this up? Does anyone have an idea?
(Info --> "Erledigt" = "Done")
Hi @Ivan
To achieve this in Jira, you can use a Workflow Validator instead of a Trigger or a condition. A Workflow Validator allows you to check conditions when transitioning an issue, and if the condition isn’t met, it displays an error message while keeping the transition button visible. Workflow condition hides the button when it does not meet the condition.
Hi @Ivan
You can use the Condition on your workflow to do exactly the behavior you explained
Here is the documentation
Sorry not the Condition, but the Validators.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hei, @Tuncay Senturk @Cyrille Martin
thank you guys for the quick answer, but what option should I choose in the Validators option?
Do I have to run my own script and choose the "Custom Script validator"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Edit your workflow and select the transition to the "Done" or "Canceled" status (for example, the transition from "In Progress" to "Done")
Then click on the transition arrow and select Validators.
Add Validator, then select ScriptRunner > Script Validator (I assume you have ScriptRunner)
Use the following Groovy script to check for unresolved subtasks. Please adjust the code to your needs and test it
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
def subTaskManager = ComponentAccessor.getSubTaskManager()
if (issue.isSubTask()) {
return true
}
def subTasks = issue.getSubTaskObjects()
// Check if any subtask is not in the "Done" status
if (subTasks.any { it.getStatusObject().getName() != "Done" }) {
invalidInputException.addErrorMessage("You cannot transition this issue to 'Done' or 'Canceled' while it has open subtasks.")
return false
}
return true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much, I tried it with your script and now it works perfectly fine. I already testes it and now I know how to do it by my own. Thank you @Tuncay Senturk !!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.