Trying to get the following custom JQL Function working in data center.
To compare a custom field and check if its group value is in the list of groups that the current user is a member of.
package com.onresolve.jira.groovy.jql
import com.atlassian.jira.JiraDataType
import com.atlassian.jira.JiraDataTypes
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.jql.operand.QueryLiteral
import com.atlassian.jira.jql.query.QueryCreationContext
import com.atlassian.jira.permission.ProjectPermissions
import com.atlassian.jira.project.version.VersionManager
import com.atlassian.query.clause.TerminalClause
import com.atlassian.query.operand.FunctionOperand
class AssignedToMyGroups extends AbstractScriptedJqlFunction implements JqlFunction {
def versionManager = ComponentAccessor.getComponent(VersionManager)
def permissionManager = ComponentAccessor.getPermissionManager()
@Override
String getDescription() {
"Issues where Group field is one of My Groups"
}
@Override
List<Map> getArguments() {
Collections.EMPTY_LIST // <1>
}
@Override
String getFunctionName() {
"AssignedToMyGroups"
}
@Override
JiraDataType getDataType() {
JiraDataTypes.VERSION // <2>
}
def groupManager = ComponentAccessor.groupManager
def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
final username = loggedInUser.username
@Override
List<QueryLiteral> getValues(
groupManager.getGroupNamesForUser(username)
)
}
Hi
We can get issues work-log/time spent by user using JQL Search Extensions plugin
JQL : issue in loggedTimeByUser("daniel") which gives you list of issues that are logged by the user
Regards,
Sudhakar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.