In a field configuration for one of our projects, we have the following in the Summary description:
AJS.$("#summary").val("Group Membership Request");
In the create screen, sometimes the Summary field gets pre-populated and sometimes is doesn't.
Sometimes youre lucky and the element with id #summary has already been rendered. Then your script is picking it up and rewriting the value as intended.
Sometimes however it is possible that the #summary element has not been rendered when your script is running. Therefore it is unable to locate the #summary element and does nothing.
try embracing the population code into document.ready event handler.
this ensures, that the script is running only when the page has finished rendering.
PS: Elements that appear in pop up dialogs are missing even when document is finished rendering.
To pick them you should bind your preopulation code to dialogContentReady event.
well populating summary for specific issue type and specific project will require more logic then just setting value for #summary. the code i have posted should make it possible to synchronize script processing with popup dialogs. there might be something else broken which prevents you from running the script. I would suggest declaring the script as ressource in global context. Then you can debug it and see if it is running at all, when it is running and whether it can see #summary element during runtime. you do it by putting the java code into .js file in main/resources folder and declaring it as webresource in main/atlassian-plugin.xml see documentation https://developer.atlassian.com/display/JIRADEV/Web+Resource+Plugin+Module
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot