Hello,
I want to use validator of a transition to prevent creating the same sub-task with the same summary.
For that - I'm using the following simple scripted validator:
ScriptRunner workflow function - Simple scripted validator (condition apply).
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
def issueManager = ComponentAccessor.getIssueManager()
Collection subTasks = issue.getSubTaskObjects()
if(issue.isSubTask())
{
def issueParent = issue.getParentObject()
def parentSubTasks = issueParent.getSubTaskObjects()
def currentSubTaskSummary = issue.getSummary()
!parentSubTasks.find{it.getSummary() == currentSubTaskSummary}
}
The problem is that I still see the option to use the transition even though I'm not expecting to see it with this validator.
Any idea?
Thanks,
Bar