Post funtion to create subtask then open subtask

Michelle Larson
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.
December 3, 2015

I have a workflow and when the user selects a transition in the workflow it fires a Script workflow function to create a sub task it works however what I would like is either for it to open it so the user can enter information in it as a pop up or just open it so the user can enter the information.

 

Also can you create a subtask of a subtask?  Example in my work flow they click next step it creates the sub task then you go into the sub task and if you select next step in the sub task it then creates another sub task?

3 answers

0 votes
GabrielleJ
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.
December 3, 2015
I would like is either for it to open it so the user can enter information in it as a pop up or just open it so the user can enter the information.

As Nic and Phill pointed out above, you cannot. If you really really need something like this, a dirty workaround I can suggest is to create a Global Transition (or just a normal one if you wish) named something like "Create Sub Task" and put a Workflow Transition Screen that has the fields you need. You may opt to hide this fields or create a separate tab for it in the Parent issue (you may also delete this information afterwards so it will not clutter the parent issue).  In this transition, create a post-function that can capture all these information and create a Sub-Task for you. 

Also can you create a subtask of a subtask? 

Nope. If you need a feature like this (on which Atlassian JIRA does not support and I strongly agree) maybe you need to revisit your requirement and do it in some other way.

lececere November 21, 2019

Hi @GabrielleJ ,

I am working on the workaround you suggest above by putting custom fields on a transition screen. I'm trying to pull the values of the custom fields into the new subtask using Scriptrunner. I'm not a developer, so I'm not familiar with the details of the code. 

Are you able to give an example or point me to where I can find code to grab those custom field values and put them into the new subtask?

Laurie

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 27, 2019
lececere December 2, 2019
0 votes
Phill Fox
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 3, 2015

Hi Michelle,

The script engine runs in the server and does not readily communicate with the users browser making it more complex to have windows/pop-ups open. However, if the information is already captured in the main issue you could populate this directly in the sub-task.

Similarly you are restricted to a single level of sub-task but can link these together.

Phill

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 3, 2015

A post-function has no interface with the front end, so no, there's nothing to open it.

And, no, you can't do sub-tasks of sub-tasks.  JIRA doesn't support it at all.

Suggest an answer

Log in or Sign up to answer