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:
<action name="admin.user.UserPickerBrowser" alias="UserPickerBrowser" roles-required="pickusers"> <view name="success">/secure/popups/userpicker.jsp</view> <view name="input">/secure/popups/userpicker.jsp</view> </action>
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).
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;">
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.