For Appfire’s Power Scripts
As a project manager, you want to save time and have better tracking by automatically generating a linked sub-task each time you create a new task.
Why is this helpful?
- You can separate an issue into smaller sub-tasks that you can assign to various team members.
- You can keep track of the time your team spends on the smaller chunks of work supporting an issue.
- Sub-tasks eliminate guesswork. You can easily report on how an issue is progressing.
- You can include specific supporting materials to very narrow aspects of an issue.

Grab this script:
Jira Data Center / Jira Server:
string parentIssueKey = key;
string issue_priority = "Critical";
string issue_summary = "Summary of the sub task";
string issue_description = "Description of the issue";
string issue_estimate = "1h 30m";
date issue_due_date = currentDate() + "30d";
if ( issueType != "Sub-task") {
string k = createIssue("Project Key", parentIssueKey, "Sub-task",issue_summary ,issue_priority, issue_description,"", issue_due_date, issue_estimate, "",{});
}
Jira Cloud
string parentIssueKey = key;
string issue_priority = "Critical";
string issue_summary = "Summary of the sub task";
string issue_description = "Description of the issue";
date issue_due_date = currentDate() + "30d";
if ( issueType != "Sub-task") {
string k = createIssue("Project Key", parentIssueKey, "Sub-task",issue_summary ,issue_priority, issue_description,"", issue_due_date,"",{});
}
- Open Jira Administration cogwheel and select Projects.
- Choose the project that you want to apply the script to, then go to Workflows.
- Open your workflow view and click on Edit.
- Click on the Create Issue transition and choose Post Functions from the right-hand side menu.
- Click on Add Post Function, choose the SIL Post Function, and click on the Add button.
- In this case, choose to add a New Script and click on Next.
- Store the script under silprograms folder or any other folder of your choice and give it a name.
- Paste the script into the editor and make sure you change the Project Key in line 10 to match your real project’s key.
- Click the Save icon in the SIL Manager then click Finish.
- Move the post function that you just created to the end of your post functions list.
- Publish your workflow.
And there you have it. For more details, follow the entire setup in this GIF.

Make this script your own:
string issue_priority = “Critical“;
Change this to adjust the priority level, like “Low” or “Medium.” Note, you might have changed the default wording in your unique Jira instance, so check your Priorities window in your Administration dashboard.
string issue_summary = “Summary of the sub task”;
Here’s where you can change the default name of your subtask. Do you want to include the name of the parent issue in the sub-task name?
Replace the highlighted portion with something like “New subtask for ” + key;
string issue_description = “Description of the issue”;
You can leave this blank, or add a default description.
string issue_estimate = “1h 30m”;
Adjust the default completion estimate. You can always individually adjust this later per sub-task.
date issue_due_date = currentDate() + “30d”;
Add the default due date. You can also change this in the sub-task window.
Last updated: 2023-07-31