Created
December 13, 2014 12:19
-
-
Save jechlin/c10454332c1d4a0a9322 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.onresolve.jira.groovy.jql | |
import com.atlassian.crowd.embedded.api.User | |
import com.atlassian.jira.jql.operand.QueryLiteral | |
import com.atlassian.jira.jql.query.QueryCreationContext | |
import com.atlassian.jira.util.MessageSet | |
import com.atlassian.query.clause.TerminalClause | |
import com.atlassian.query.operand.FunctionOperand | |
import com.onresolve.jira.groovy.jql.entitymatch.VersionMatch | |
import groovy.util.logging.Log4j | |
@Log4j | |
class ThisMonthsReleases extends VersionMatch { | |
@Override | |
String getFunctionName() { | |
"thisMonthsReleases" | |
} | |
@Override | |
String getDescription() { | |
"Get issues with releases this month" | |
} | |
@Override | |
List<Map> getArguments() { | |
[] | |
} | |
FunctionOperand getOperand() { | |
def fs = new Date().format("yyMM") | |
new FunctionOperand(super.getFunctionName(), ".*$fs.*") | |
} | |
@Override | |
List<QueryLiteral> getValues(QueryCreationContext queryCreationContext, FunctionOperand operand, TerminalClause terminalClause) { | |
return super.getValues(queryCreationContext, getOperand(), terminalClause) | |
} | |
@Override | |
MessageSet validate(User searcher, FunctionOperand operand, TerminalClause terminalClause) { | |
return super.validate(searcher, getOperand(), terminalClause) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment