JIRA SU Question - I tweaked the userbrowser.jsp file, but I can only SU for JIRA Internal Users, not users created via active directory. Why?

Justin Corcoran
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.
February 13, 2013

I recently updated to JIRA 5.2.6. Previously, JIRA SU worked fine (JIRA 5.1.x). Now, after re-editing the userbrowser.jsp file to add the SU link, I can only SU for users that are in the JIRA Internal Directory. The link simply doesn't display for users managed via Active Directory.

Has anyone experienced this? Is there a fix?

2 answers

1 accepted

0 votes
Answer accepted
Justin Corcoran
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.
February 13, 2013

Here you go. Note that I use "Impersonate" instead of "SU".

<%@ taglib uri="webwork" prefix="ww" %>
<%@ taglib uri="webwork" prefix="ui" %>
<%@ taglib uri="webwork" prefix="aui" %>
<%@ taglib uri="sitemesh-page" prefix="page" %>
<%@ taglib uri="jiratags" prefix="jira" %>
<html>
<head>
	<title><ww:text name="'admin.menu.usersandgroups.user.browser'"/></title>
    <meta name="admin.active.section" content="admin_users_menu/users_groups_section"/>
    <meta name="admin.active.tab" content="user_browser"/>
    <jira:web-resource-require modules="jira.webresources:userbrowser,
        com.atlassian.plugins.helptips.jira-help-tips:common" />
</head>
<body>

<ww:property value="/opsbarLinks" >
    <ww:if test="./empty == false">
        <header>
            <nav class="aui-toolbar">
                <div class="toolbar-split toolbar-split-right">
                    <ul class="toolbar-group">
                        <ww:iterator value=".">
                            <li class="toolbar-item">
                                <ww:bean name="'com.atlassian.jira.web.util.HelpUtil'" id="helpUtil" />
                                <a href='<ww:property value="./url" />'
                                   class="toolbar-trigger trigger-dialog"
                                   id='<ww:property value="./id" />'
                                   title='<ww:property value="./title" />'
                                   data-url='<ww:property value="@helpUtil/helpPath('add.new.users')/url" />'>
                                    <span class="icon icon-add16"></span>
                                    <ww:property value="./label" />
                                </a>
                            </li>
                        </ww:iterator>
                    </ul>
                </div>
            </nav>
        </header>
    </ww:if>
</ww:property>

<page:applyDecorator id="user-filter" name="auiform">
    <page:param name="action">UserBrowser.jspa</page:param>
    <page:param name="method">post</page:param>
    <page:param name="cssClass">top-label</page:param>
    <page:param name="submitButtonText"><ww:text name="'navigator.tabs.filter'"/></page:param>
    <page:param name="cancelLinkURI">UserBrowser.jspa?emailFilter=&group=&max=<ww:property value="filter/max"/></page:param>
    <page:param name="cancelLinkText"><ww:text name="'admin.userbrowser.reset.filter'"/></page:param>

    <aui:component template="formHeading.jsp" theme="'aui'">
        <aui:param name="'text'"><ww:text name="'admin.userbrowser.filter.users'"/></aui:param>
    </aui:component>
    <ww:property value="filter">
        <div class="aui-group">
            <div class="aui-item">
                <page:applyDecorator name="auifieldgroup">
                    <aui:textfield label="text('admin.userbrowser.username.contains')" maxlength="255" id="'userNameFilter'" name="'userNameFilter'" theme="'aui'">
                        <aui:param name="'cssClass'">full-width</aui:param>
                    </aui:textfield>
                </page:applyDecorator>
            </div>
            <div class="aui-item">
                <page:applyDecorator name="auifieldgroup">
                    <aui:textfield label="text('admin.userbrowser.userfullname.contains')" maxlength="255" id="'fullNameFilter'" name="'fullNameFilter'" theme="'aui'">
                        <aui:param name="'cssClass'">full-width</aui:param>
                    </aui:textfield>
                </page:applyDecorator>
            </div>
            <div class="aui-item">
                <page:applyDecorator name="auifieldgroup">
                    <aui:textfield label="text('admin.userbrowser.email.contains')" maxlength="255" id="'emailFilter'" name="'emailFilter'" theme="'aui'">
                        <aui:param name="'cssClass'">full-width</aui:param>
                    </aui:textfield>
                </page:applyDecorator>
            </div>
            <div class="aui-item">
                <page:applyDecorator name="auifieldgroup">
                    <aui:select label="text('admin.userbrowser.in.group')" id="'group'" name="'group'" list="/groups" listKey="'name'" listValue="'name'" theme="'aui'">
                        <aui:param name="'cssClass'">full-width</aui:param>
                        <aui:param name="'defaultOptionText'" value="text('common.filters.any')" />
                        <aui:param name="'defaultOptionValue'" value="''" />
                    </aui:select>
                </page:applyDecorator>
            </div>
            <div class="aui-item">
                <page:applyDecorator name="auifieldgroup">
                    <aui:select label="text('admin.userbrowser.users.per.page')" id="'usersPerPage'" name="'max'" list="/maxValues" listKey="'.'" listValue="'.'" theme="'aui'">
                        <aui:param name="'cssClass'">full-width</aui:param>
                        <aui:param name="'defaultOptionText'" value="text('common.words.all')" />
                        <aui:param name="'defaultOptionValue'" value="'1000000'" />
                    </aui:select>
                </page:applyDecorator>
            </div>
        </div>
    </ww:property>
</page:applyDecorator>
<div class="aui-group count-pagination">
    <div class="results-count aui-item">
        <ww:text name="'admin.userbrowser.displaying.users'">
            <ww:param name="'value0'"><span class="results-count-start"><ww:property value="niceStart" /></span></ww:param>
            <ww:param name="'value1'"><span class="results-count-end"><ww:property value="niceEnd" /></span></ww:param>
            <ww:param name="'value2'"><span class="results-count-total"><ww:property value="users/size" /></span></ww:param>
        </ww:text>
    </div>
    <div class="pagination aui-item">
        <ww:if test="filter/start > 0">
            <a class="icon icon-previous" href="<ww:url page="UserBrowser.jspa"><ww:param name="'start'" value="filter/previousStart" /></ww:url>"><span><< <ww:text name="'common.forms.previous'"/></span></a>
        </ww:if>
        <ww:property value = "pager/pages(/browsableItems)">
            <ww:if test="size > 1">
                <ww:iterator value="." status="'pagerStatus'">
                    <ww:if test="currentPage == true"><strong><ww:property value="pageNumber" /></strong></ww:if>
                    <ww:else>
                        <a href="<ww:url page="UserBrowser.jspa"><ww:param name="'start'" value="start" /></ww:url>"><ww:property value="pageNumber" /></a>
                    </ww:else>
                </ww:iterator>
            </ww:if>
        </ww:property>
        <ww:if test="filter/end < users/size">
            <a class="icon icon-next" href="<ww:url page="UserBrowser.jspa"><ww:param name="'start'" value="filter/nextStart" /></ww:url>"><span><ww:text name="'common.forms.next'"/> >></span></a>
        </ww:if>
    </div>
</div>
<table class="aui aui-table-rowhover" id="user_browser_table">
    <thead>
        <tr>
            <th>
                <ww:text name="'common.words.username'"/>
            </th>
            <th>
                <ww:text name="'common.words.fullname'"/>
            </th>
            <th class="minNoWrap">
                <ww:text name="'login.details'"/>
            </th>
            <th>
                <ww:text name="'common.words.groups'"/>
            </th>
            <th>
                <ww:text name="'admin.user.directory'"/>
            </th>
            <th class="minNoWrap">
                <ww:text name="'common.words.operations'"/>
            </th>
        </tr>
    </thead>
    <tbody>
    <ww:iterator value="currentPage" status="'status'">
    <tr class="vcard user-row" data-user="<ww:property value="name"/>">
        <td data-cell-type="username"><div><a id="<ww:property value="name"/>" rel="<ww:property value="name"/>" class="user-hover user-avatar" style="background-image:url(<ww:property value="/avatarUrl(name)"/>);" href="<ww:url page="ViewUser.jspa"><ww:param name="'name'" value="name"/></ww:url>">
            <span class="username"><ww:if test="active==false"><del></ww:if><ww:property value="name"/><ww:if test="active==false"></del><br>(<ww:text name="'admin.common.words.inactive'"/>)</ww:if></span>
        </a></div></td>
        <td data-cell-type="fullname">
            <span class="fn"><ww:if test="active==false"><del></ww:if><ww:property value="displayName"/><ww:if test="active==false"></del></ww:if></span><br />
            <a href="<ww:url page="ViewUser.jspa"><ww:param name="'name'" value="name"/></ww:url>"><span class="email"><ww:property value="emailAddress"/></span></a>
        </td>
        <td data-cell-type="login-details" class="minNoWrap">
            <ww:if test="/everLoggedIn(.) == true">
                <strong><ww:text name="'common.concepts.count'"/>:</strong> <ww:property value="/loginCount(.)" /><br />
                <strong><ww:text name="'common.concepts.last'"/>:</strong> <ww:property value="/lastLogin(.)" /><br />
                <br />
            </ww:if>
            <ww:else>
                <ww:text name="'login.not.recorded'"/><br />
            </ww:else>
            <ww:if test="/elevatedSecurityCheckRequired(.) == true">
                <strong><i><ww:text name="'login.elevated.security.check.required'"/></i></strong><br />
                <strong><ww:text name="'login.last.failed.login'"/>:</strong> <span id="lastFailedLogin"><ww:property value="/lastFailedLogin(.)" /></span><br />
                <strong><ww:text name="'login.current.failed.login.count'"/>:</strong> <span id="currentFailedLoginCount"><ww:property value="/currentFailedLoginCount(.)" /></span><br />
                <strong><ww:text name="'login.total.failed.login.count'"/>:</strong> <span id="totalFailedLoginCount"><ww:property value="/totalFailedLoginCount(.)" /></span><br />
                <a data-link-type="reset-login-count" href="<ww:url page="ResetFailedLoginCount.jspa"><ww:param name="'name'" value="name" /><ww:param name="'returnUrl'" value="'secure/admin/user/UserBrowser.jspa'"/></ww:url>"><ww:text name="'admin.resetfailedlogin.title'"/></a>
            </ww:if>
        </td>
        <td data-cell-type="user-groups">
            <ul>
            <ww:iterator value="/groupsForUser(.)">
                <li><a href="<ww:url page="ViewGroup.jspa"><ww:param name="'name'" value="."/></ww:url>"><ww:property value="."/></a></li>
            </ww:iterator>
            </ul>
        </td>
        <td data-cell-type="user-directory"><ww:property value="/directoryForUser(.)"/></td>
        <td data-cell-type="operations">
            <ul class="operations-list">
                <ww:if test="/remoteUserPermittedToEditSelectedUsersGroups(.) == true">
                    <li><a class="editgroups_link" id="editgroups_<ww:property value="name"/>" href="<ww:url page="EditUserGroups!default.jspa"><ww:param name="'name'" value="name" /><ww:param name="'returnUrl'" value="'UserBrowser.jspa'" /></ww:url>"><ww:text name="'common.words.groups'"/></a></li>
                </ww:if>
            <li><a id="projectroles_link_<ww:property value="name"/>" href="<ww:url page="ViewUserProjectRoles!default.jspa"><ww:param name="'name'" value="name" /><ww:param name="'returnUrl'" value="'UserBrowser.jspa'" /></ww:url>"><ww:text name="'common.words.project.roles'"/></a></li>
                <ww:if test="/remoteUserPermittedToEditSelectedUser(.) == true">
				<li><a id="su_link_<webwork:property value='name'/>" href="<ww:url page='JiraSU.jspa'><ww:param name="'name'" value='name' /></ww:url>">Impersonate</A></li>
                    <li><a id="edituser_link_<ww:property value="name"/>" href="<ww:url page="EditUser!default.jspa"><ww:param name="'editName'" value="name" /><ww:param name="'returnUrl'" value="'UserBrowser.jspa'" /></ww:url>"><ww:text name="'common.words.edit'"/></a></li>
                    <li><a id="deleteuser_link_<ww:property value="name"/>" href="<ww:url page="DeleteUser!default.jspa"><ww:param name="'name'" value="name" /><ww:param name="'returnUrl'" value="'UserBrowser.jspa'" /></ww:url>"><ww:text name="'common.words.delete'"/></a></li>
                </ww:if>
            </ul>
        </td>
    </tr>
    </ww:iterator>
    </tbody>
</table>
<div class="aui-group count-pagination">
    <div class="pagination aui-item">
        <ww:if test="filter/start > 0">
            <a class="icon icon-previous" href="<ww:url page="UserBrowser.jspa"><ww:param name="'start'" value="filter/previousStart" /></ww:url>"><span><< <ww:text name="'common.forms.previous'"/></span></a>
        </ww:if>
        <ww:property value = "pager/pages(/browsableItems)">
            <ww:if test="size > 1">
                <ww:iterator value="." status="'pagerStatus'">
                    <ww:if test="currentPage == true"><strong><ww:property value="pageNumber" /></strong></ww:if>
                    <ww:else>
                        <a href="<ww:url page="UserBrowser.jspa"><ww:param name="'start'" value="start" /></ww:url>"><ww:property value="pageNumber" /></a>
                    </ww:else>
                </ww:iterator>
            </ww:if>
        </ww:property>
        <ww:if test="filter/end < users/size">
            <a class="icon icon-next" href="<ww:url page="UserBrowser.jspa"><ww:param name="'start'" value="filter/nextStart" /></ww:url>"><span><ww:text name="'common.forms.next'"/> >></span></a>
        </ww:if>
    </div>
</div>
</body>
</html>

Justin Corcoran
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.
March 6, 2013

Any updates on this? I really need to be able to "SU" my users.

Justin Corcoran
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.
March 6, 2013
Andy helped me out on his GetSatisfaction site:
Andy Brook (Official Rep) 4 minutes ago
Ah this is a logic bug, the link is inside a velocity #if #else, you just need to move it above the #if, I should update the wiki, give me a minute.
0 votes
Tiago Comasseto
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.
February 13, 2013

Hi Justin,

Could you past here the content of your userbrowser.jsp file? Then we can take a look at your modifications and see if there is some wrong.

Cheers

Suggest an answer

Log in or Sign up to answer