How to implement a Jira plugin that limit account name allowed at SignUp?

I want to write a Jira plugin that force people to use a certain username pattern when they register their accounts in Jira.

This is happening inside the form is displayed at `/secure/Signup!default.jspa` and is based on `$JIRA_INSTALL/atlassian-jira/views/signup.jsp` view.

Still, I have no idea what to put inside the plugin in order to make it fail, and also I do not want to go the easy way and implement this in JavaScript on the client, not because of security, just because I want a solution that does not brake when you upgrade Jira.

Update: I found that - still I'm not sure how to implement this in a plugin and preferably writing a minimal amount of code.

Probably what I need is to throw a CreateExeption from inside the plugin, but what to implement inside the plugin to throw this?

2 answers

1 accepted

Because I don't want to loose my customization each time I'm doing a Jira update, I ended up writing a jQuery check. I know, it is not safe but it is better than loosing changes on updates.

You have to overwrite the Signup WebAction as described in this tutorial:

In this case it should be the following definition in your atlassian-plugin.xml:

<webwork1 key="new-signup" name="New Signup" class="java.lang.Object">
            <action name="" alias="Signup">
                <view name="success">/views/signup-success.jsp</view>
                <view name="limitexceeded">/views/signup-limitexceeded.jsp</view>
                <view name="alreadyloggedin">/views/signup-alreadyloggedin.jsp</view>
                <view name="error">/views/signup.jsp</view>
                <view name="input">/views/signup.jsp</view>
                <view name="modebreach">/views/modebreach.jsp</view>
                <view name="systemerror">/views/signup-systemerror.jsp</view>

Then you have to extend com.atlassian.jira.web.action.user.Signup and validate the username:

    protected void doValidation() {

        if (getUsername().matches("mypattern")){
            addError("username", getText("mytext"));


Then the user sees a red error message at the username field.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

211 views 1 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you