Hi,
I need to add around 300 'Security Levels' to a particular 'Issue Security Scheme' in JIRA along with the groups.
Is it possible to implement this using Scriptrunner plugin or through Groovy or any other way?
Thanks,
Rupa
Here is code to create a new scheme, and a new level with a single group:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.security.IssueSecuritySchemeManager import com.atlassian.jira.scheme.SchemeEntity def issueSecurityLevelManager = ComponentAccessor.getIssueSecurityLevelManager() def issueSecuritySchemeManager = ComponentAccessor.getComponent(IssueSecuritySchemeManager) def scheme = issueSecuritySchemeManager.createSchemeObject("FRIDAY", "Issue security scheme for testing") def level = issueSecurityLevelManager.createIssueSecurityLevel(scheme.id, "Private", "Group only") def entity = new SchemeEntity("group", "jira-users", level.id) def gv = issueSecuritySchemeManager.getScheme(scheme.id) issueSecuritySchemeManager.createSchemeEntity(gv, entity)
I'm trying to get this to work in Jira 7.3.1, can you help? The final two lines no longer work it seems
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.
Hi!
Need help with creating the the entity for user custom field value (multiuser customfield) , I tried
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Issue security levels can have a "Group Custom Field Value". Why don't you write the customer group to a group custom field (can be hidden), and use that in the security scheme.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it's ok if you don't need single user view only... I have proposed the solution with custom field multiple users, the same approach
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your method is very flexible, I agree. Easy to combine multiple groups etc if you need to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Security Level is set automatically through Groovy post function depending on which group the Reporter belongs to.
Example: Say there are two Customers ABC and XYZ.
ABC has 2 users Sam and Betty.
XYZ has 2 users Tom and Harry.
What we need is that Sam can see what ticket Betty creates (what users of ABC create) and should not be able to view what all tickets Tom and Harry create(XYZ users).
Is this possible using your solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
May I propose a better solution? I have implemented something like this in my company see the link: "Visible For" field in JIRA
Now, if you need the issue to be visible by that customer, just add him to Visible For
P.S. Add all customers to any project role with browse permission, so that role can see issues in the project - permission scheme.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Security Level is set automatically through Groovy post function depending on which group the Reporter belongs to.
Example: Say there are two Customers ABC and XYZ.
ABC has 2 users Sam and Betty.
XYZ has 2 users Tom and Harry.
What we need is that Sam can see what ticket Betty creates (what users of ABC create) and should not be able to view what all tickets Tom and Harry create(XYZ users).
Is this possible using your solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can change multiple user picker to multiple group picker and put Sam's group in that field. (you can even make a postfunction to fill visible for field with sam's group)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it possible to make this Group Picker field non-searchable when using Advanced JQL?
I tried using the 'Search Template' but it does not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will propose the solution I have implemented in my company in the answer section, cause select one of 300 security levels from the dropdown will be a headache.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We have that many different customers using the same project and hence need that many levels so that they cannot see tickets created by other Customers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
issueSecurityLevelManager.createIssueSecurityLevel(scheme.id, "Private", "Reporter only")
But, agree with Alex.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jamie,
I tried the following:
import com.atlassian.jira.issue.security.IssueSecurityLevelManager
IssueSecurityLevelManager issueSecurityLevelManager;
issueSecurityLevelManager.createIssueSecurityLevel(11238,"Sample Level","Example")
But getting an error : Cannot invoke method createIssueSecurityLevel() on null object
Also is there a way to add group-name or multiple group-names to Security levels?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had previously used Jelly to accomplish this:
<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib">
<jira:CreateIssueSecurityScheme name="FRIDAY ISSUE SCHEME">
<jira:AddIssueSecurityLevel name="Test level1" description="">
<jira:AddIssueSecurity type="group" group="abc-users"/>
<jira:AddIssueSecurity type="group" group="xyz-users"/>
</jira:AddIssueSecurityLevel>
</jira:CreateIssueSecurityScheme>
</JiraJelly>
Looking to find its alternative within Scriptrunner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to get the IssueSecurityLevelManager via ComponentAccessor
def issueSecurityLevelManager = ComponentAccessor.getIssueSecurityLevelManager()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
woah! 300 security levels on a single scheme? Don't you want to re-think the architecture?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.