Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation Subtask

Jasti Trinadh April 23, 2020

Hello Team,

As we want to create the Subtask automatically

The main point is when the parent ticket is creating automatically the subtask also want to create automatically even though we don't want to create subtask manually. and we are using JIRA Cloud and we have Licensed Script runner Add-on. so please help me with triggering points step by step or please help me the script code and step by step process and any Automatons we want to do in Service desk for these requirement if there is having any automatons for automatic subtask please help me detailed way ASAP

Thanks for understanding!!!

Regards
jtrinadh@ascap.com

3 answers

0 votes
Kristian Walker _Adaptavist_
Community Champion
April 23, 2020

Hi Jasti,

Thank you for your question.

I can confirm that with ScriptRunner for Jira Cloud we provide the built in Create Subtask post function as documented here which you could add into your workflow onto the Create transition for when the issue is created in order to automatically create the sub-task that you require below the issue. 

The documentation page linked to for the Create Subtask post function provides some step by step instructions on how to configure this post function inside of a workflow that you will be able to follow.

As your post function will be on the Create transition in the workflow, you will need to ensure that the post function is ordered as the last post function in the list of post functions.

The reason for this is that the issue is not actually created until the post function with the name of Re-index an issue to keep indexes in sync with the database. has ran which means that if your Create Subtask post function appears before this in the list of post functions then the issue wont exist to create the sub-task under.

Alternatively you could write some custom code to Create a Subtask and I can confirm we have an example script located here which can be run on the Script Console in order to create a sub-task for a specific issue and you will be able to use this script as a reference guide to help you create the script that you require.

I hope this information helps.

Regards,

Kristian

0 votes
Jack Brickey
Community Champion
April 23, 2020

Given you are on Cloud I would probably use the built in Project automation (project > project settings > project automation OR if on NG project - project > project settings > apps> project automation). You will want to use some condition to control when a sub-task is and is not created. I’m assuming you don’t want a sub-task for every issue created. Here is and example...

trigger - issue created

condition - maybe issue type or label or component or...

action - create sub-task

Here is the documentation for Project Automation - automate-your-jira-cloud-processes-and-workflows 

if you wish to use Scriptrunner you do this via workflow post functions. In the Scriptrunner post-functions there is a built-in postfunction to create a sub-task based on a condition. You can do this by editing the workflow and add a post function the the create transition. Scriptrunner documentation is here - http://scriptrunner-docs.connect.adaptavist.com/jiracloud/quickstart.html?_ga=2.216778582.1747788409.1587642442-1805967310.1587642442 

0 votes
Mohamed Benziane
Community Champion
April 23, 2020

Hello @Jasti Trinadh 

Welcome to the community.

You can follow the documentation for scriptrunner:

https://scriptrunner.adaptavist.com/latest/jira/tutorials/scripted-post-functions-tutorial.html

You will needd to add a postfunction in your workflow when you create an issue to automatically create subtask.

 

It's also possible with automation :

https://support.atlassian.com/jira-software-cloud/docs/automation-actions/

https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Can-I-create-sub-tasks-with-required-fields-using-Automation-for/qaq-p/111357

Hope this helps

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events