Editing Default Users to Project Role shows error
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
Editing Default Users to Project Role shows the following error in JIRA:
FILL IN LOGAn error occurred whilst rendering this message. Please contact the
administrators, and inform them of this bug. Details: -------
org.apache.velocity.exception.MethodInvocationException: Invocation of
method 'getUserPickerHtml' in class
com.atlassian.jira.web.action.admin.roles.UserRoleActorAction threw
exception java.lang.NullPointerException at
com.atlassian.jira.plugin.system.projectroleactors:atlassian-user-role-actor-action//templates/plugins/jira/projectroles/user-role-actor.vm[line 21, column 9]
at
org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:223)
at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.Template.merge(Template.java:328) at
org.apache.velocity.Template.merge(Template.java:235) at
org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:381)
at
com.atlassian.velocity.DefaultVelocityManager.writeEncodedBodyImpl(DefaultVelocityManager.java:117)
at
com.atlassian.velocity.DefaultVelocityManager.writeEncodedBody(DefaultVelocityManager.java:97)
at
com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.toWriterImpl(DefaultVelocityTemplatingEngine.java:146)
at
com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.asHtml(DefaultVelocityTemplatingEngine.java:134)
at
com.atlassian.jira.web.dispatcher.JiraVelocityViewDispatcher.dispatch(JiraVelocityViewDispatcher.java:50)
at
com.atlassian.jira.web.dispatcher.JiraWebworkViewDispatcher.dispatchViaVelocityView(JiraWebworkViewDispatcher.java:110)
at
com.atlassian.jira.web.dispatcher.JiraWebworkViewDispatcher.dispatchView(JiraWebworkViewDispatcher.java:69)
at
com.atlassian.jira.web.dispatcher.JiraWebworkActionDispatcher.service(JiraWebworkActionDispatcher.java:204)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at
Diagnosis
- Checking from JIRA will show that some of the users exist in the Roles page but when searching from the "Users page", some of the users do not exist.
Run the following query to find users who exist in app_user table but not in cwd_user table:
select roletypeparameter from projectroleactor where roletype = 'atlassian-user-role-actor' and roletypeparameter not in (select user_key from app_user);
Cause
This issue can happen if JIRA have NULL values from pid column in projectroleactor table. Since some of the ID data is missing from database, JIRA is not able to retrieve users
Resolution
- Stop JIRA.
- Backup JIRA
Search for the related NULL pid in the projectroleactor table by using the SQL query below:
SELECT id, pid, (select name from projectrole where id = projectroleid), roletypeparameter FROM projectroleactor WHERE pid IS NULL;
Take note the project role and username. Remove the entries from the returned results by using SQL below:
DELETE FROM projectroleactor where pid IS NULL
- Restart JIRA.
- Manually edit the members through JIRA UI to add users to the project role.