Create subtask dialog - change default subtask

Hi,

I have several subtask types and with the create subtask dialog, Jira shows by default the first alphabetically in the Issue Type select. I would like to change this via jquery, but I am stuck since this is a modal window and don't know how to set a proper selector/condition so I can modify the selected option once the dialog is open.

Any ideas?

Thanks a lot!

7 answers

1 accepted

Thanks for the tip! just rearranging the options as you describe made the trick.

0 vote
Janet Albion Atlassian Team Mar 04, 2013

Hi Adolfo,

Do you want to change the sequence in the Create Subtask screen or in the Issue Navigator? Perhaps a screenshot of your desirable goal will help.

It's in the create subtask dialog where I'd like to change the default subtask type.

I've tried the following code (posted in the announcement banner) without luck so far. This is Jira 5.2

AJS.$(document).ready(function() {
var val1 = 'option a';
var val2 = 'option b';

AJS.$(document).bind("dialogContentReady", function(event, dialog) {

AJS.$("select#issuetype.select.imagebacked.issuetype-field option").each(function() {
      if (AJS.$(this).text() == val1) {
        AJS.$(this).removeAttr('selected');
      }
 if (AJS.$(this).text() == val2) {
         AJS.$(this).attr('selected','selected');
      }
});
});
});

0 vote
Janet Albion Atlassian Team Mar 04, 2013

Adolfo,

Have you tried arranging the subtask in the Issue Type Scheme for the project ? For example, if the sequence is:

  1. Bug
  2. Improvement
  3. subtaskC
  4. subtaskA
  5. subtaskB

Then, in the Create Subtask page, the subtasks should appear in the same sequence instead of alphabetically.

@Janet Albion [Atlassian] This works!

By reorganizing the sub-tasks under Issue Types Scheme does the trick.

Thank you guys!

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

123 views 4 9
Read article

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