Hello,
Could someone help me with ScriptRunner REST endpoint running on Confluence Server 7.2.0?
I just need to remove user permissions from space only. For example, I pass username and space key, and the script removes all permissions. I've been trying to use SpaceManager, SpaceManagerInternal but my context is always null.
def space = spaceManager.getSpace(spaceKey)
SpacePermissionContext context = SpacePermissionContext.builder().build()
spacePermissionManager.removeAllUserPermissions(user,context)
The builder().build() doesn't work, and createDefault() as well.
How do I use this context in the right way?
Thanks.
Hi Cristian!
I have written the exact what you told me, but now it doesn't show me the message error when the fix version is not complete.
I fogot to tell you that I am using Groovy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you using a simple validator or a scripted validator? Note that this are not the same. In Simple validator you don't need to use
throw new InvalidInputException("Fix Version/s is required");
But you ned to use it in a scripted validator
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.
If you are using scripted validator use this:
import com.opensymphony.workflow.InvalidInputException
if (issue.getFixVersions()) {throw new InvalidInputException("Fix Version/s is required");
}
If you are using Simple Validator, this should be enough:
issue.getFixVersions()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not have Script Runner installed (the company doesn't want to invest money on this) so I have installed Code Runner Groovy, and I have written the code in my first post. But As I have said, when the fix version has a value then it shows the error "An unknown exception occured executing Validator com.atlassian.jira.workflow.SkippableValidator@17eedcdc: root cause: java.lang.NullPointerException"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not have Script Runner installed (the company doesn't want to invest money on this) so I have installed Code Runner Groovy, and I have written the code in my first post. But As I have said, when the fix version has a value then it shows the error "An unknown exception occured executing Validator com.atlassian.jira.workflow.SkippableValidator@17eedcdc: root cause: java.lang.NullPointerException"
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.