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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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/
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.