Create subtask dialog - change default subtask

Adolfo Casari
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.
March 4, 2013

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

1 vote
Answer accepted
Adolfo Casari
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.
March 4, 2013

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

1 vote
Fadoua Boualem January 5, 2016

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

Thank you guys!

 

0 votes
Matthew Mares July 8, 2015

@Janet Albion [Atlassian] This works!

demo-riverbed June 28, 2018

This doesn't work. I use Jira 7 and I found that If I have multiple subtasks, for example:

1/ subtaskA

2/ subtaskB

3/ subtaskC

This subtasks are in order in the issue type scheme.

When I create the subtask and selecte subtask issue type as "subtaskB". This creates the subtask "subtaskB". 

 

Now, I move to another issue (say Task) and try to create a subtask. It defaults to "subtaskB" and not to "subtaskA" which is set the issue type scheme in the project.

Adolfo Casari
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.
June 29, 2018

I believe that in JIRA 7 the previous comments are not valid anymore. You shoud try to use Jquery to rerrange the options.

0 votes
Janet Albion
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 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.

0 votes
Adolfo Casari
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.
March 4, 2013

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 votes
Adolfo Casari
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.
March 4, 2013

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

0 votes
Janet Albion
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 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.

Suggest an answer

Log in or Sign up to answer