Default log in user in text field

Aditya kumar Madhira October 1, 2013

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

0 votes
Answer accepted
RambanamP
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.
October 1, 2013

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
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.
October 1, 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