Open Create Sub-Task Dialog after Main-Task transition

We have two issue types: Main-task and Sub-Task

After pressing the Workflow-Button "need additional information" of a main-task, the status should switch to "pending" and the create sub-task dialog should open immediately. In the new dialog we want to create a sub-task like "ask john doe for more info"

Question: Is it possible to open the create Sub-Task-Dialog after a Main-Task transition?

Any ideas to solve this behavior?

7 answers

In the transition in the workflow, you assign the Sub-task dialog:

Transition: Create Compliance Request

You are viewing an active workflow. Create a draft workflow.

Transition View: Create Compliance Action Request

Then, in the post-function of the transition you call a script:

All Conditions (1) Validators (0) Post Functions (6)

Set issue status to the linked status of the destination workflow step.
Add a comment to an issue if one is entered during a transition.
Update change history for an issue and store the issue in the database.
Re-index an issue to keep indexes in sync with the database.
Fire a Generic Event event that can be processed by the listeners.
Script /data/atlassian/jira/scriptrunner/RPDCreateComplianceActionRequest.groovy will be run.
The script will create the subtask:
issueObject = issueFactory.getIssue()
issueObject.setIssueTypeObject(subtaskIssueType ) 

//bunch of code here putting the customfields onto the object

subtaskIssue = issueManager.createIssueObject(currUser, issueObject)

Hi Nancy,

thx for your fast answer, but your solution doesn't work for me.


- The Screen is not the original Create-SubTask Screen. The Subtask-Task-Type picker is missing

- The Screen-Title and Submit-Button Label is not correct

- The entered Attributes in the Subtask-Screen are also persist in the main-task (e.g. summary)

Any other idea?

Hi Olaf,

Were you able to come up with a solution for this? I am trying to do something similar, where I would like a workflow transition to launch the "ceate Sub-Task" Dialog,



Hi Shay,

our requirement are changed a little bit:

- Execute sub-transition (in background)

- Change the status of the sub-issue

- Show a prefilled create sub-issue dialog

- User can create the sub-issue or cancel the creation process. status is still changed.

- Create a issue link between the first sub-issue (initiator) to the second issue

To solve the above requierments I do a lot of JavaScript-Stuff and deploy this as a plugin.

Some highlights:

- remove/add transtion class from transition-button


- replace current parentId with correct parentId

- replace default click-handler with own click-handler


- make rest-call for transtion while create sub-issue dialog is visible

var szURL = AJS.contextPath() + '/rest/ontrack-rest/2.0/workflowservice/performworkflowaction';
var postData = {
"issueId": issueId,
"action": action

Maybe this information helps a little bit.


Hi Olaf,

Thank you for the reply. That is helpful.

I did something similar in the end to resolve the problem, I used some simple JS to find the workflow transition i.e. "Create New Version" and replace the class and the href with those of the actual create-task button.

<script type="text/javascript">

AJS.$(document).ready(function($) {

if (AJS.$("a:contains(Create New Version)")){

var href = AJS.$(".issueaction-create-subtask").attr('href')

AJS.$("a:contains(Create New Version)").addClass("issueaction-create-subtask").attr("href", href);




thanks again,


Shay, I am looking to do something similar. I am rather new to Jira, where exactly would you place the JS above?

Hi Roger, I am quite new to JIRA myself and have found the only way to execute JS on the page is to embed it in a CustomField description.

So find a customfield that appears on the view screen of the issue in the CustomField section of Issue admin. Edit the CustomField and in the description add your javascript as above. You will want to replace the label "Create New Version" with the label of your transition.

Now when you click on the transition it should open the create-subtask popup.



Hey guys, It seems to work, but whatever parentIssueId I use, the actual parent issue displayed on the dialog is the one being displayed on the view issue screen. If I open the dialog from another screens, no parent issue is displayed on the dialog. How can I set the parentIssueId? Any clues? Thanks

Suggest an answer

Log in or Sign up to answer
Community showcase

Scrum Roles Explained: the Do's and the Don'ts

Hello Community,  Today we are going to talk about the three Scrum Roles. There is the Development Team, the Scrum Master and the Product Owner. In my opinion these three are all really impo...

101 views 1 5
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