Hey community
I've a problem, In my listener I need to change the selector when the user change a field.
In theory is easy when in a regular field, but in this case I need to change the field security level.
I've 3 levels in my security and I want to change depending of the user,
With this I can get the tree levels:
def result2 = get('/rest/api/3/issuesecurityschemes/10000/')
.queryString("overrideScreenSecurity", Boolean.TRUE)
.header('Content-Type', 'application/json')
.asObject(Map)
But now I need change the level in the issue.
Can you help me?
Thank's
Changing the security level based on user is quite simple,
just get the field option id for the security levels and set it like this:
import com.atlassian.jira.ComponentManager ComponentManager componentManager = ComponentManager.getInstance() User currentUser = componentManager.getJiraAuthenticationContext().getUser() if(currentUser.name == "akirk") { issue.setSecurityLevelId(10001) } else if(currentUser.name == "jojo") { issue.setSecurityLevelId(10000) }
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.