Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Set Issue Security Level Plugin not working

Jan Räther June 27, 2012

Hi,
we are currently testing JIRA 5.0.6. We migrated our 4.4.3 prod JIRA to the new version and encounter a problem now.

The plugin "Set Issue Security Level Plugin" was used to set a security level for a customer ticket based on his customer group. Unfortunately, this is not working anymore. Creating a ticket with post function

Set the issue security level - Set the issue security level based on user's specified group

does not work - nothing happens when clicking on "Create".

We are using the original version 1.0 which worked from 3.13 until 4.4.3.

I found

http://forums.atlassian.com/thread.jspa?forumID=100&threadID=42900

but this does not help; I don't know how to "build" this new version.

I know that a few people are still using this plugin. What are your solutions for 5.x incompatibility?

6 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Jan Räther July 2, 2012

Problem solved by creating the plugin completely new using new methods.

Sanu Soman May 27, 2013

Hi Jan,

Could you please share the plug-in details. We are stuck with our JIRA migration due to this plug-in.

Please help.

Thanks,

Sanu P Soman

0 votes
Rafael Mizrahi May 27, 2013

you can build this plugin using the instructions at

https://github.com/processone/jira-security-level-plugin

after building the jar, just place it at /home/jira/jira/jira-standalone/atlassian-jira/WEB-INF/lib

0 votes
Rafael Mizrahi April 8, 2013
here is an update which works on jira 5.2.8
package securitylevel.jira.plugin.postfunction;

import com.atlassian.crowd.embedded.api.User;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.issue.security.IssueSecurityLevel;
import com.atlassian.jira.issue.security.IssueSecurityLevelManager;
import com.atlassian.jira.security.groups.GroupManager;
import com.atlassian.jira.event.type.EventDispatchOption;

import com.opensymphony.module.propertyset.PropertySet;
import com.opensymphony.workflow.FunctionProvider;

import java.util.Collection;
import java.util.Map;

public class SetSecurityLevelFunction implements FunctionProvider {

	private final IssueSecurityLevelManager issueSecurityLevelManager = ComponentAccessor
			.getIssueSecurityLevelManager();

	private final GroupManager groupManager = ComponentAccessor
			.getGroupManager();

	@SuppressWarnings("rawtypes")
	public void execute(Map transientVars, Map args, PropertySet ps) {

		MutableIssue issue = (MutableIssue) transientVars.get("issue");
		User reporter = issue.getReporterUser();
		Collection<String> reporterGroups = groupManager
				.getGroupNamesForUser(reporter.getName());

		try {
			Collection<IssueSecurityLevel> issueSecurityLevels = issueSecurityLevelManager
					.getUsersSecurityLevels(issue.getProjectObject(), reporter);

			for (String groupName : reporterGroups) {
				
				for (IssueSecurityLevel securityLevel : issueSecurityLevels) {

					String securityLevelName = securityLevel.getName();

					if (securityLevelName.startsWith("#")
							&& securityLevelName.subSequence(1,
									securityLevelName.length()).equals(
									groupName)) {
						issue.setSecurityLevelId(securityLevel.getId());
						saveIssue(issue);
						return;
					}
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	private void saveIssue(MutableIssue issue) {
		
		IssueManager issueManager = ComponentAccessor.getIssueManager();
		User user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
		boolean sendEmail = false;
		
		issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH, sendEmail);
	}
}


Sanu Soman May 27, 2013

How I can add this one in our JIRA instance?

0 votes
Bogusław Osuch April 4, 2013

Hi everyone,

could You please provide a desired functionality or link to this plugin homepage?

We would like to implement this functionality in one of our free plugins.

Sanu Soman May 27, 2013

Hi,

Did you got any solution for this?

0 votes
Peter February 7, 2013

Hi again,

Anybody, would to provide a source code of set issue security level plugin, that works on jira 5.x? Or, maybe exists a good alternative of it?

0 votes
Peter January 20, 2013

Hi como

> Problem solved by creating the plugin completely new using new methods.

Would you publish a working version of this plugin? We urgent need of this functionality and can't migrate to actual version of jira without same actions. Will glad to received your answer and more glad to get working "set issue security level" plugin. :)

Regards

Peter

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events