Users of my application already have to login, so the application knows the user's name and email address. How do I auto-populate the name and email fields using values from my application that are displayed in the embedded jira issue collector?
I second the solution by ICANSEEYOU7867. Works perfectly for me and I'm a hack.
My issue collector is embedded in Confluence. I added the function in my custom Jira script (javascript) then used the alias in the fieldValues:
<script src="your Jira issue collector source URL"></script>
<script type= "text/javascript">
function getCurrentUserName(inVar) {
var user;
var emailaddr;
jQuery.ajax({
url: "/rest/gadget/1.0/currentUser",
type: 'get',
dataType: 'json',
async: false,
success: function(data) {
user = data.username;
emailaddr = data.email;
}
}); if (inVar == 'username') {
return user;
} else if (inVar == 'email') {
return emailaddr;
} else {
return user;
}
}
//YOUR CUSTOM ISSUE COLLECTOR
$(document).ready(function() { window.ATL_JQ_PAGE_PROPS = $.extend(window.ATL_JQ_PAGE_PROPS, { // ==== COLLECTOR NAME ==== 'COLLECTOR ID' : { // === custom trigger function === triggerFunction : function( showCollectorDialog ) { $('#custom button').click( function(e) { e.preventDefault(); showCollectorDialog(); }); } // === default and hidden field values === , fieldValues : { // default values summary : 'some text here if you want' , description : 'some text here if you want' ,email : getCurrentUserName('email') ,fullname : getCurrentUserName('username') } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sean M While creating the issue collector the screen associated with the issue collector we can customize it, Check the project and issue types and associated screens with that. do changes to the screen then you can customize the web form. for you question create a custom fields and to screen.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, I was really looking for a way to set the name/email field that is built into the JIRA issue collector? I'd rather not create custom fields for name/email when those fields already exist...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its crock of Sh** you cant dont bother wasting your time any more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was posting this collector onto a confluence page that uses the same authentication system. So I know the usernames/emails are the same. So you can get all of this info (And more!) with a little bit of extra javascript.
I tried to paste javascript code here, but this form wont let me...
At least with confluence, I can pull my username info using the confluence currentuser API.
I can also pull information about the confluence page from the meta content values (Such as key name, dispName, etc...) and I can use this info to automatically populate my fields. In this case, I want to make sure I have a link, space key and article name in my collector so that we can know which confluence issue needs more info or some TLC.
As long as you can pull the username/email with javascript, this method should be doable automagically. So theoretically this example would look like:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The solution in the pastebin by ICANSEEYOU7867 works like a charm for me - thank you!
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.