Default log in user in text field

Hi I want to set default sign in user in select field while creating issue. SO please tell me how to do it

2 answers

1 accepted

Accepted Answer
0 votes

try with this script

<script type="text/javascript">
jQuery(document).ready(function($) {
    JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) {
        setDefaultValues();
    });
        setDefaultValues();
     
function setDefaultValues(){
		var currentUser=getCurrentUserName();
        $("#customfield_11329").val(currentUser);
}
     
function getCurrentUserName()
{
var user;
     AJS.$.ajax({
        url: "/rest/gadget/1.0/currentUser",
        type: 'get',
        dataType: 'json',
        async: false,
        success: function(data) {
            user = data.username;
        }
     });
     return user;
}
 
});
</script>

refer this

https://answers.atlassian.com/questions/196399/js-to-set-custom-field-based-on-a-project?page=1#comment-197895

0 votes
Timothy Chin Community Champion Oct 01, 2013

You might want to search for resouces about using Javascript on the screens. There are already plenty of answers around.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 25, 2018 in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

467 views 7 5
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