convert subtask to issue and change fields as well as ststus

We need to convert a sub task to a parent issue. I would like to have the ability to change the status and a set of fields.

I see the wizard has a place for workflow status and for changing fields. When the wizard runs the status portion of the wizard is not editable. 

Also, the field I need to change is not available.

How can I make the wizard render the status change and the fields I need edited.

2 answers

This widget could not be displayed.

The status change only happens if the workflow for the target issue type does not include the current status of the issue.  Similarly for the fields - it will only offer you the fields you actually need to change during the issue type change.

If you want to update other stuff, you have to do it as an edit, before or after the issue type move.

This widget could not be displayed.

Another option would be to add a "Convert to Issue" workflow step (going back to the same state) and include a screen with the appropriate fields.  The workflow step will require a scriptrunner post function that does the actual conversion/unlink.  I recently wrote such a script:

import com.atlassian.jira.issue.issuetype.IssueType;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.util.IssueUpdateBean;

IssueLinkManager issueLinkManager = ComponentAccessor.getIssueLinkManager();
MutableIssue mutIssue = (MutableIssue)issue;
IssueType issueType = issue.getIssueTypeObject();
String newIssueTypeId = "3"; // Task

if (issueType.isSubTask()) {
    if(issueType.getName()=="Sub-Defect") {
        newIssueType=1; // Bug
    Issue parentIssue = issue.getParentObject();
    IssueLink subTaskLink = issueLinkManager.getIssueLink(parentIssue.getId(),issue.getId(),10000);

This is certainly not the prettiest solution, as you potentially have to add this workflow step for every state.  You would also probably want to add a condition that prevents others from seeing the transition.  This won't work at all if you have a need to select the new issue type manually (as is done using the wizard) though you could probably hack that via a custom field that you set during the edit, and then reference/clear during the script.

I wrote this for the purpose of doing bulk "Convert to Issue" as that feature isn't available until JIRA7; however, the bulk convert didn't work, the wizard threw an error when the self-referencing state transition was selected.

At a guess, convert+edit is the more reasonable approach here.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

161 views 1 3
Join discussion

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