Unable to Create More than One User When Importing With JellyScript

Chris Farver July 11, 2011

I'm currently attempting to import issues into JIRA by using Jelly. I have a test script that I've been trying to run, but continually get stopped with the error message:

Exception: org.apache.commons.jelly.JellyTagException: null:9:0: java.lang.NullPointerException

By looking at where the import ends, I can tell that it always hits the error after attempting to create the second new user.

It might not be ideal, but in my script I'm attempting to import comments from old users that won't be included in JIRA, but because Jelly doesn't allow inactive users to import comments, I'm attempting to create a user before every comment, and then deleting them right after. I saw this working a few days ago, so I don't know why the script is contiually failing.

java.lang.NullPointerException

at com.atlassian.jira.jelly.NewUserContextAccessorImpl.setNewUserContext(NewUserContextAccessorImpl.java:78)at com.atlassian.jira.jelly.NewUserContextAccessorImpl.setNewUserContext(NewUserContextAccessorImpl.java:73)at com.atlassian.jira.jelly.NewUserContextAccessorImpl.setNewUser(NewUserContextAccessorImpl.java:35)at com.atlassian.jira.jelly.NewUserContextAccessorImpl.loadPreviousNewUser(NewUserContextAccessorImpl.java:50)at com.atlassian.jira.jelly.tag.admin.CreateUser.loadPreviousNewUser(CreateUser.java:65)at com.atlassian.jira.jelly.tag.admin.CreateUser.endTagExecution(CreateUser.java:40)at com.atlassian.jira.jelly.ActionTagSupport.doTag(ActionTagSupport.java:136)at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247)at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)at org.apache.commons.jelly.impl.StaticTag.doTag(StaticTag.java:65)at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:102)at com.atlassian.jira.web.action.util.JellyRunner.doExecute(JellyRunner.java:96)at
etc..
(If it makes a difference, I can post the full log)

2 answers

0 votes
Betsy Walker
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2011

My bet would be that some of one of your users has a name -- like O'Brien -- that contains a special character. In JELLY, you must escape these characters: ampersand, apostrophe/single quote, double quote, less than symbol and greater than symbol.

See the Writing A Jelly Script section of this page: http://confluence.atlassian.com/display/JIRA/Jelly+Tags

Chris Farver July 17, 2011

Unfortunately that isn't it. I've run tests on it a few times, and haven't used a name with a special character yet.

0 votes
Jo-Anne MacLeod
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2011

As a test, can you pull the line that creates that second user and see if the gets any further. It's possible that there may be something different about that one user that is causing the problem. If it carries on then you know that it is that one line, if it gets stuck on the next line then you know that it is something more general in your script.

Chris Farver July 12, 2011

I've done similar tests already, in which I've moved the lines around and it always fails on the second added user.

I am able to create and delete the same user multiple times over again, but whenever I attempt to create a 2nd user, it fails.

Suggest an answer

Log in or Sign up to answer