Hello Team,
I have a Java script which works pretty well except for the case when a issue create pop up screen appears. It works for this case too but after I have opened the pop up screen two times, it starts pre populating the field value the third time I open the create pop up window, any idea as to how I could make changes to the code so that it works the very time I open the create pop up window.
<script type="text/javascript">
(function($) {
// This is for when an issue is being created while
// opened in a new window tab
AJS.toInit(function(){
if (AJS.$("#issue-create-submit").val()=="Create" // || AJS.$("#create-issue-submit").val()=="Create"
){
var issuetype=AJS.$("#issue-create-issue-type").text();
if(issuetype=="Task"){
$(document.getElementById("customfield_14041")).change(function(){
switch ($(document.getElementById("customfield_14041")).val()) {
case "23125":
AJS.$("#assignee-field").val("Sushma.nagaraj");
break;
default:
AJS.$("#assignee-field").val("Sushma.nagaraj");
}
});
}
}
});// This is when issue is being created via dialog box popup.
//AJS.$(document).ready(function() {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
if (
// AJS.$("#issue-create-submit").val()=="Create" ||
AJS.$("#create-issue-submit").val()=="Create"){
var issuetype=AJS.$("#issuetype-field").val();
if(issuetype=="Task"){
$(document.getElementById("customfield_14041")).change(function(){
switch ($(document.getElementById("customfield_14041")).val()) {
case "23125":
AJS.$("#assignee-field").val("Sushma.nagaraj");
break;
default:
AJS.$("#assignee-field").val("Sushma.nagaraj");
} });}
}
});})(AJS.$);
</script>
Hi!
I am using jsincluder, this app help me forget a lot event listeners and so on.
https://marketplace.atlassian.com/apps/1211670/jsincluder
hope it helps you also:)
Because you can in related screen and action.
Cheers,
Gonchik Tsymzhitov
Hello Gonchik,
The jsincluder looks really cool. But I would like some manipulations to the existing code itself because we already have a lot of add ons and we may slow down the system having a few more.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Could you extend listener condidtion? (INLINE_EDIT_BLURRED)
https://developer.atlassian.com/server/jira/platform/extending-inline-edit-for-jira-plugins/
Cheers,
Gonchik Tsymzhitov
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.