I'm currently using the following scriptrunner code in my post creation transition validator, but it's throwing an error.
Code -
reporter = issue.reporter jql = "project = PE and resolution = Unresolved and reporter = currentUser()" jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser) searchService = ComponentAccessor.getComponent(SearchService) query = jqlQueryParser.parseQuery(jql) count = searchService.searchCount(reporter, query) if (count >= 2) { throw new InvalidInputException("The limit of open tickets for the 'PE' project is reached for the current user") } Error - ScriptRunner Script. The configuration is invalid.
The goal is to limit current users from not being able to open more than two tickets at a time.