Create a sub-task in specific status

Dennis S_ November 7, 2018

Hi everybody,

 

we have a "normal" workflow and a sub-task-workflow. I would like to create a sub-task automatically when a specific transition in the parent issue is performed. I´ve realized that with a script runner workflow function "create a subtask". So far, so good. 

 

Now, I would like to set the automatically created sub-task in the second status (automatically, just in the moment when it is created). I´ve already tried several scripts to transition the sub-task and ordered it after the "create subtask" script in the transition, but it seems like the sub-task is not created before the transition is completed.

 

Any ideas, how to set the sub-task in the second status initially when it is created automatically.

 

Thank you in advance for your support.

 

Best regards

Dennis

2 answers

1 accepted

2 votes
Answer accepted
Orkun Gedik
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.
November 7, 2018

Hi @Dennis S_,

Firstly, @Tom Lister is right. You can also follow some other ways to that. As far as I understand, when a specific transition performed you want to create subtask which will be created on the second status. If I get it correctly, you can ;

  1. Place another script postfunction(custom) in the subtask's create transition. The script is going to change the status of created subtask issue. In my opinion, this is not a correct way to handle this problem because if you want to create a subtask manually, it will automatically move to second status.
  2. Other way which I recommend is change your script post function. Write a custom script post function and create your subtask over there. After that get the created subtask in script and move its status to second status.

If you need help while coding script let me know. Hope this helps your problem. Good luck. 

 

Best Regards,

Orkun Gedik

  

Deleted user November 7, 2018

The second method is preferred. 

Though @Dennis S_, could I ask why you want this automated functionality?

Thanks

Dennis S_ November 11, 2018

Hi @Orkun Gedik,

 

thank your for the prompt reply. Your suggested solution works perfectly!

@[deleted]: The automated functionality is required due to internal processes. The workflows (both of them) are very complex, so some automations are unavoidable.

 

Best regards

Dennis

1 vote
Tom Lister
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 7, 2018

Hi @Dennis S_

When issues are created they always start in the first status in your workflow.

You can use scriptrunner to then  transition the subtask to the status you want.

Jeff Tillett
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.
April 12, 2024

How? example? This is exactly what I'm trying to figure out how to do, found this thread, and found this answer which confirmed I'm on the right path, but is entirely unhelpful. 

Suggest an answer

Log in or Sign up to answer