I am getting the following errors during a re-index of the system with Jira 6.3.1.
I can't find anything related to the error - userKey should not be null!
here are the complete errors in the logs -
2014-08-11 15:35:54,868 IssueIndexer:thread-3 ERROR ahughes 933x5998x1 1k1hgkv 1.1.1.1 /secure/admin/IndexReIndex.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] userKey should not be null!
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: userKey should not be null!
at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySetForUserKey(DefaultUserPropertyManager.java:44)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySet(DefaultUserPropertyManager.java:38)
at com.atlassian.jira.user.UserPropertyManager$getPropertySet$1.call(Unknown Source)
at Script2.run(Script2.groovy:11)
2014-08-11 15:35:54,875 IssueIndexer:thread-3 ERROR ahughes 933x5998x1 1k1hgkv 1.1.1.1 /secure/admin/IndexReIndex.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] userKey should not be null!
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: userKey should not be null!
at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySetForUserKey(DefaultUserPropertyManager.java:44)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySet(DefaultUserPropertyManager.java:38)
at com.atlassian.jira.user.UserPropertyManager$getPropertySet$1.call(Unknown Source)
at Script10.run(Script10.groovy:11)
2014-08-11 15:35:54,918 IssueIndexer:thread-3 ERROR ahughes 933x5998x1 1k1hgkv 1.1.1.1 /secure/admin/IndexReIndex.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] userKey should not be null!
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: userKey should not be null!
at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySetForUserKey(DefaultUserPropertyManager.java:44)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySet(DefaultUserPropertyManager.java:38)
at com.atlassian.jira.user.UserPropertyManager$getPropertySet$1.call(Unknown Source)
at Script24.run(Script24.groovy:11)
2014-08-11 15:35:55,493 IssueIndexer:thread-1 ERROR ahughes 933x5998x1 1k1hgkv 1.1.1.1 /secure/admin/IndexReIndex.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] userKey should not be null!
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: userKey should not be null!
at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySetForUserKey(DefaultUserPropertyManager.java:44)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySet(DefaultUserPropertyManager.java:38)
at com.atlassian.jira.user.UserPropertyManager$getPropertySet$1.call(Unknown Source)
at Script2.run(Script2.groovy:11)
2014-08-11 15:35:55,498 IssueIndexer:thread-1 ERROR ahughes 933x5998x1 1k1hgkv 1.1.1.1 /secure/admin/IndexReIndex.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] userKey should not be null!
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: userKey should not be null!
at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySetForUserKey(DefaultUserPropertyManager.java:44)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySet(DefaultUserPropertyManager.java:38)
at com.atlassian.jira.user.UserPropertyManager$getPropertySet$1.call(Unknown Source)
at Script10.run(Script10.groovy:11)
2014-08-11 15:35:55,524 IssueIndexer:thread-1 ERROR ahughes 933x5998x1 1k1hgkv 1.1.1.1 /secure/admin/IndexReIndex.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] userKey should not be null!
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: userKey should not be null!
at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySetForUserKey(DefaultUserPropertyManager.java:44)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySet(DefaultUserPropertyManager.java:38)
at com.atlassian.jira.user.UserPropertyManager$getPropertySet$1.call(Unknown Source)
at Script24.run(Script24.groovy:11)
2014-08-11 15:43:39,472 IssueIndexer:thread-6 ERROR ahughes 933x5998x1 1k1hgkv 1.1.1.1 /secure/admin/IndexReIndex.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] userKey should not be null!
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: userKey should not be null!
at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySetForUserKey(DefaultUserPropertyManager.java:44)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySet(DefaultUserPropertyManager.java:38)
at com.atlassian.jira.user.UserPropertyManager$getPropertySet$1.call(Unknown Source)
at Script2.run(Script2.groovy:11)
2014-08-11 15:43:39,484 IssueIndexer:thread-6 ERROR ahughes 933x5998x1 1k1hgkv 1.1.1.1 /secure/admin/IndexReIndex.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] userKey should not be null!
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: userKey should not be null!
at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySetForUserKey(DefaultUserPropertyManager.java:44)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySet(DefaultUserPropertyManager.java:38)
at com.atlassian.jira.user.UserPropertyManager$getPropertySet$1.call(Unknown Source)
at Script10.run(Script10.groovy:11)
2014-08-11 15:43:39,515 IssueIndexer:thread-6 ERROR ahughes 933x5998x1 1k1hgkv 1.1.1.1 /secure/admin/IndexReIndex.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] userKey should not be null!
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: userKey should not be null!
at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySetForUserKey(DefaultUserPropertyManager.java:44)
at com.atlassian.jira.user.DefaultUserPropertyManager.getPropertySet(DefaultUserPropertyManager.java:38)
at com.atlassian.jira.user.UserPropertyManager$getPropertySet$1.call(Unknown Source)
at Script24.run(Script24.groovy:11)
I found out what the issue was - We have a custom user field named Customer and the scripted reads the public user properties from these users. Several entries had the users login I.D. set instead of the full name.
example Customer: asmith
Should have been set to Customer: Smith, Abby
Once it was changed to the full name, the errors are gone
The most recent release has better and more concise error messages for script field failures.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the second field (Read and Display User Properties on Main Issues)
replace
propValue = userPropertyManager.getPropertySet(dirUser)?.getString('jira.meta.'+propKey);
with
if (null != dirUser) propValue = userPropertyManager.getPropertySet(dirUser)?.getString('jira.meta.'+propKey);
and try to reindex again
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if that didn't help:
try { propValue = userPropertyManager.getPropertySet(dirUser)?.getString('jira.meta.'+propKey); } catch (Exception e) { //ignore nullpointer }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Most possible you've deleted some user that was used in configuration of the script custom field. You should review your existing script field and check if they contain proper data. Do you use those fields at all? Please check https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+Fieldsfor details
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
3.) Display Previous Issue Key Number
import com.atlassian.jira.ComponentManager
def componentManager = ComponentManager.getInstance()
def changeHistoryManager = componentManager.getChangeHistoryManager()
x = changeHistoryManager.getPreviousIssueKeys(issue.id)
if (x.join(' ') == "") {
return null
}
return x.join(' ')
4.) Display Parent Issue Custom Numeric Field on Sub-tasks
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.component.ComponentAccessor;
field = ComponentAccessor.getCustomFieldManager().getCustomFieldObject('customfield_13000')
if (issue.isSubTask())
{
def abc456 = issue.getParentObject().getCustomFieldValue(field);
return abc456
}
return null;
5.) Display Parent Issue Custom Date field on Sub-Tasks
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.component.ComponentAccessor;
field = ComponentAccessor.getCustomFieldManager().getCustomFieldObject('customfield_11401')
if (issue.isSubTask())
{
def abc456 = issue.getParentObject().getCustomFieldValue(field);
return abc456
}
return null;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I haven't deleted any users used in the configuration.
Here are the scripted fields setup -
1.) Display Parent Issue Attachments on Sub-tasks
2.) Read and Display User Properties on Main Issues
3.) Display Previous Issue Key Number
4.) Display Parent Issue Custom Numeric Field on Sub-tasks
5.) Display Parent Issue Custom Date field on Sub-Tasks
And here is the code for each -
1) Display Parent Issue Attachments on Sub-tasks
import com.atlassian.jira.issue.attachment.Attachment;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.ComponentManager;
String s = "";
if(null != issue.parentObject)
{
for(Attachment att : issue.parentObject.attachments)
{
s = s +"<a href=\"" + ComponentManager.getInstance().getApplicationProperties().getString("jira.baseurl")+
"/secure/attachment/"+att.id+"/"+att.filename+"\">"+att.filename+"</a>" + "<br>";
}
}
return s;
2.) Read and Display User Properties on Main Issues
import com.atlassian.jira.user.ApplicationUsers;
import com.atlassian.crowd.embedded.api.User;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.user.UserPropertyManager;
UserPropertyManager userPropertyManager = ComponentAccessor.getUserPropertyManager();
String propKey = "public Location";
String propValue = null;
def u = getCustomFieldValue('Customer')
if (u) {
def dirUser = ApplicationUsers.toDirectoryUser(u)
propValue = userPropertyManager.getPropertySet(dirUser)?.getString('jira.meta.'+propKey);
}
return propValue;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As Alexey said, it looks like the problem is that a user has been renamed.
What version of the plugin are you using?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It needs to have better error messages than that, I'll look into it.
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.