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.
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; import com.atlassian.jira.issue.link.IssueLink; import com.atlassian.jira.issue.link.IssueLinkManager; 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); issueLinkManager.removeIssueLink(subTaskLink,ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()); mutIssue.setParentObject(null); mutIssue.setIssueTypeId(newIssueTypeId); }
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.