How to use user select field in my forms?

Hi!

I need to select users and groups in form in my plugin. I can use user picker and get username from it (or groupname for group) but how to use autocomplete? I have tried some ways but nothing works.

I need help.

Thanks.

1 answer

1 accepted

0 vote

How are you drawing the fields into your add-on, and what type of add-on is it?

I'm not drawing fields. I just added input into velocity template. Then I added link like this:

"<jira>/plugins/secure/popups/UserPickerBrowser.jspa"

what type of add-on is it?

What do you mean?

The type of plugin was to ask whether it's a Server or Connect add-on, as they're structured very differently.

As you're working with velocity, that strongly suggests it's an add-on for Server.

Your attempt to include the field like that is simply not going to work.  A jspa page is a generated page that is built on-the-fly within a specific context.  You are demanding a rendering of it with no context sit, so there's no way it's going to work.

Your vm needs to implement the code in the field in context in order to do this.

So, there is only one solution: to inmlement my own autocomplete? And is it really there is no way to use built-in custom field?

I suspect you might be able to parse the .vm file for the User Picker as it's built into JIRA, but you'll have to do it with the right context set, providing all the variables it needs in it.

Might be easier to use it as a base for your own coding.

Thank you. However it is not solution that I wanted...

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...

153 views 1 17
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