Hi,
I have a small validation requirement in jira. In our jira I am planning to bring a validation for below scenario
If the logged in user belongs to "ABC" user group and if the user is trying to assign a issue to him/herself it is not allowed. Same way if the user belongs to other groups, then the same operation is allowed.
Is this possible without writing a explicit plugin for that? If I want to write a plugin what is the plugin module type I have to use?
Please help me on this.
Community moderators have prevented the ability to post new answers.
You should disable built-in action to assign issue in given project and use the workflow action instead with appropriate condition checking user group membership. For prototyping there are handy scripted conditions from Script Runner plugin.
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.
To create a modified "group without current user" permission type you should extend package com.atlassian.jira.security.type.GroupDropdown and overwrite the methods
public boolean hasPermission(GenericValue entity, String groupName, com.atlassian.crowd.embedded.api.User user, boolean issueCreation); public Set<com.opensymphony.user.User> getUsers(PermissionContext ctx, String groupName);
Do it the following way for hasPermission (note this is not valid code, just to give you an idea where you must code something)
boolean hasPermission (...) { current_user=getCurrentUser() if (current_user.memberOf(groupName)) { return false; } return super.hasPermission(...) } Set getUsers(..) { current_user=getCurrentUser() result = super.getUsers(...); if (current_user.memberOf(groupName)) { result = new ArrayList(result) result.remove(current_user) } return result; }
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.