I'm trying to use the Abacus Sub-Task Rollup to Issue on a customized Sub Task issue type, but it does not work. I've tried with the same fields in to a subtask and it did work.
Is some configuration missing?
Try to write like this
import com.atlassian.jira.component.ComponentAccessor
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def allowedUser = ComponentAccessor.groupManager.getGroupNamesForUser(currentUser).contains("AllowedGroup")
jiraHelper?.project?.key != "TARGETPROJECT" || allowedUser
Hey Alexey,
Thanks for the quick answer. HOWEVER, I tried it as you put it in there (substituting back in the "real" group and project name. As before, it works BUT throws the error about every 2s:
http-nio-8080-exec-639 ERROR anonymous 990x6405302x1 - 172.26.10.19,127.0.0.1 / [c.o.scriptrunner.fragments.JiraScriptCondition] Script condition failed: java.lang.NullPointerExceptionAny thoughts?
Any thoughts? I have been forced (for the nonce) to run behind an NGINX proxy. Could that be giving me the problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you change the script to this one
import com.atlassian.jira.component.ComponentAccessor
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
log.error("Current user: " + currentUser)
def allowedUser = ComponentAccessor.groupManager.getGroupNamesForUser(currentUser).contains("AllowedGroup")
log.error("allowed User: " + allowedUser)
jiraHelper?.project?.key != "TARGETPROJECT" || allowedUserand see the logs?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the problem is with the currentUser because you execute your script under anonymous user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm... Could be... I find that in the console it knows who *I* am if I try it in there and gives the expected true/false responses depending on what arguments I put in the script.
As much as I am loathe to hard code anything, should I, rather fill in actual humans rather than ask who is on the system at the moment? Perhaps it IS seeing it for things that come in via the API.
Conversely, should I put an explicit please ignore anonymous and what would the groovy look like for that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you run the script I provided. In my case I get the user under which I am authenticated to Jira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yup, @Alexey Matveev, you've hit the nail on the head. It IS the anonymous user:
http-nio-8080-exec-630 ERROR anonymous 1033x6421258x1 - 172.26.10.19,127.0.0.1 / [c.o.scriptrunner.fragments.JiraScriptCondition] Current user: null
How might I code to ignore the null/anonymous user?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
import com.atlassian.jira.component.ComponentAccessor
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
log.error("Current user: " + currentUser)
if (currentUser != null) {
def allowedUser = ComponentAccessor.groupManager.getGroupNamesForUser(currentUser).contains("AllowedGroup")
log.error("allowed User: " + allowedUser)
jiraHelper?.project?.key != "TARGETPROJECT" || allowedUser
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well... that DID fix the continuous errors on null.. However (and I could live with this if I had to), it throws a pair of errors when navigating into and then out of the project with the hidden "Create" button
2018-01-30 18:27:53,996 http-nio-8080-exec-675 ERROR anonymous 1107x6486713x2 uvyzdk 172.26.10.103,127.0.0.1 /browse/HIDDEN [c.a.j.w.f.steps.requestcleanup.WebworkActionCleanupStep] Thread corrupted! ActionContext still references a HttpRequest. URL: 'https://companyURL.com/browse/HIDDEN'. Attempted to clean up: true
2018-01-30 18:27:57,928 http-nio-8080-exec-677 ERROR anonymous 1107x6486787x2 uvyzdk 172.26.10.103,127.0.0.1 /browse/VISIBLE [c.a.j.w.f.steps.requestcleanup.WebworkActionCleanupStep] Thread corrupted! ActionContext still references a HttpRequest. URL: 'https://companyURL.com/browse/VISIBLE'. Attempted to clean up: true
Something to live with or is there another module I should hide besides just the "com.atlassian.jira.jira-header-plugin:create-issue" module?
Further info: In looking at it, it SEEMS that the projects that throw the error are those that include the group that should be able to see the "Create" button in the project it is conditionally hidden...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately I can not recreate your example in my Jira. In my Jira I have no errors and the current user is the user under whom I log in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think your extension is the correct one. It works but just that error. I greatly appreciate all your help on this. I suspect it is something that I'll eventually uncover. When I took over this system when moving to this company, I basically inherited a dumpster fire with extra hobos. At least I have the hobos mostly at bay...
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.