How is the multi-user popup launched?

Brad Leary February 17, 2014

I'm trying to write a custom field that is similar to the multi-user field. (It contains a list of items and has a popup used for finding additional items to add to the list.) However, I haven't been able to figure out how the multi-user field is launching its popup.

In the Jira source, /jira-project/jira-components/jira-core/src/main/resources/system-customfieldtypes-plugin.xml shows the velocity template to be here: templates/plugins/fields/edit/edit-multiuser.vm

The velocity template contains this link:
<a class="popup-trigger" href="#"><span class="aui-icon icon-userpicker" title="$i18n.getText('user.picker.select.users')"></span></a>

That appears to be a link to nowhere. Something must be overwriting the target of that link, because clicking it opens a popup with this url: /secure/popups/UserPickerBrowser.jspa?formName=jiraform&multiSelect=true&decorator=popup&element=customfield_10000

The actions.xml contains this definition for UserPickerBrowser:

&lt;action name="admin.user.UserPickerBrowser" alias="UserPickerBrowser" roles-required="pickusers"&gt;
        &lt;view name="success"&gt;/secure/popups/userpicker.jsp&lt;/view&gt;
        &lt;view name="input"&gt;/secure/popups/userpicker.jsp&lt;/view&gt;
    &lt;/action&gt;

What I can't figure out is what determines that clicking that link triggers the UserPickerBrowser action. Can anyone help me out?


I have also tried following this tutorial for creating a dialog:
https://developer.atlassian.com/display/JIRADEV/Displaying+Content+in+a+Dialog+in+JIRA
But it seems to be broken. Immediately after checking the code out of git, the "atlas-integration-test" command fails. Ignoring that failure and continuing the tutorial does me no good, because the "atlas-run" command fails to launch jira from that project (I've had no issues launching jira from my other projects).

2 answers

1 accepted

0 votes
Answer accepted
Brad Leary February 19, 2014

I didn't figure out exactly how the multi-user popup is launched, but I am able to launch a popup using javascript in the onclick event:

<a class="popup-trigger" href="/jira/secure/popups/Test.jspa" onclick="window.open('/jira/secure/popups/Test.jspa?element=${customField.id}', 'pams_asset_browser', 'width=780, height=575, resizable, scrollbars=yes'); return false;">

0 votes
Nabil Sayegh
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.
August 17, 2016

Suggest an answer

Log in or Sign up to answer