Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Display username on header beside requests option

Pujitha Boddeti February 12, 2018

As the user is logged in , I want they name to be displayed on the header bar on top.

1 answer

0 votes
Fabio Racobaldo _Herzum_
Community Champion
February 13, 2018

Hi Pujitha,

in order to do that you can add the following javascript on the JIRA Announcement banner :

<script>
jQuery().ready(function() {
//LOGGED USERS SCRIPTS
if(jQuery(".login-link").size()==0){
//Display logged user
var userDisplayName = jQuery("#header-details-user-fullname").attr("data-displayname");
jQuery(".aui-header-secondary").children().prepend("<li><a id=\"user-item\" class=\"aui-nav-link\" title=\"logged user\" href=\"/secure/ViewProfile.jspa\">"+userDisplayName+"</a></li>");
}
});
</script>

If you use a specific jira context, please, add it to href. For example if your context is "jira", href should be ... href=\"/jira/secure/ViewProfile.jspa\">

Hope this helps.

Fabio

Pujitha Boddeti February 13, 2018

Hi Thanks for athe answer :)

But I want the name to be displayed when service desk project users are logged in to raise a request.

 

The following script allowed me to display my name in my admin account, but how about to all the user accounts.

Regards,

Pujitha

Fabio Racobaldo _Herzum_
Community Champion
February 13, 2018

Sorry Pujitha, I missed the context.

In order to do that, you need to implement a  plugin for JSD with web-resource module, and set the context to <context>customerportal</context>. The javascript should be similar to that provided.

CIao,

fabio

Pujitha Boddeti February 13, 2018

Thank you , this is quite helpful ! :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events