Forums

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

Create issue with scriptrunner

Sachin Guttala
Contributor
May 20, 2025

We need to automatically create a child ticket whenever a ticket of a specific issue type is created. Could you please suggest a ScriptRunner script for this?”

3 answers

1 vote
Phong Hong Nguyen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 21, 2025

Hi @Sachin Guttala 

I understand that you are inquiring about the use of ScriptRunner. However, I recommend considering Automation, as it readily supports this scenario.

You can select the specific issue type and the child tasks.

Screenshot 2025-05-21 at 5.08.07 pm.png

Screenshot 2025-05-21 at 5.09.34 pm.png

If you were already aware of Automation and still prefer to use ScriptRunner, I apologise for any oversight.

 

Cheers.

1 vote
Piyush Annadate _ACE Pune_
Community Champion
May 21, 2025

Hi, 
I would suggest to go ahead and create the ticket via Automation - that's quick.

Anyhow, if looking for child issues (as I'm counting your ask as subtask) check https://www.scriptrunnerhq.com/help/example-scripts/create-a-subtask-cloud 

https://www.scriptrunnerhq.com/help/example-scripts/create-a-task-cloud

You may need to alter more for your requirements with above.

0 votes
Kristian Walker _Adaptavist_
Community Champion
May 21, 2025

Hi Sachin,

You could achieve this use case using ScriptRunner for Jira Cloud.

To achieve this use case, I would advise using a Script Listener.

Using this feature, you can configure it to run on the Issue Created event and add a condition in the conditions box to make it run for only specific issue types. We have an example of the condition to do this here that you can use as an example.

Finally, we have an example script here that shows the code for creating a subtask. 

The config then looks like the screenshot below.

Screenshot 2025-05-21 at 09.05.52.png

I hope this helps.

Regards,

Kristian

Suggest an answer

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

Atlassian Community Events