JIRA Stories and Sub-tasks

Shankar Rao Pala January 31, 2014

Hello Everyone.

Could you please assist in letting me know if it is possible to do the following in JIRA ?

The requirement is to add a "button"/action in Jira Story Page. When user clicks on that button, it should generate three “sub-tasks” under that story.

We would like to create three to four standard tasks (E.g. Create Test Data, Design Test Case, Execute Test Case, Develop / update product documentation) under every story for tracking the hours of each of the sub task, add notes etc.

The above will apply to all the stories.

Please let me know your thoughts in this regard.

Regards,

Shankar

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 31, 2014

You'll need a bit of code. The task itself is suited to a workflow post-function - i.e. when a user goes from status A to status B, then you could run one (or three!) that would create the sub-tasks you need. If've you have the script-runner, this is quite an easy bit of code, and there are some add-ons in the marketplace which do "create sub task" as well.

The button is a different matter. If you use a workflow post-function as above, then you could add it into the workflow at the relevant place - you could even have a transition that doesn't change the status, and just creates the sub-tasks. If you must have a button, then you'll need to code a web-fragment add-on to add one, and then you put all your "create issue" code behind that as well.

While you're coding, consider how you stop someone hitting the button more than once as well...

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
January 31, 2014

I would recommend the first option that Nic suggests - a post function using the script runner (free) or my paid add-on: Create on Transition Plugin for JIRA . When we did these types of cases via post functions, it provided a JIRA consistent UI experience for users and a standard way of handling the particular use case and many other use cases that kept coming up. The warning about duplicate issue creation is very important. Make sure your logic includes that. How to create multiple issues - advanced example discusses this.

Shankar Rao Pala February 1, 2014

Hi Nic, Bob:

Thank you for the response to my request. I would try going with the first option i.e. to make use of workflow-post function to create sub-tasks for a story.

Please provide your inputs on how to create sub-tasks using Script-Runner plugin. Also if you could provide reference documentation on how to approcah towards this solution, it would be of great help.

Again, thanks for your inputs!

Shankar

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2014

The script runner documentation has sample code for "create sub task"

Start at https://jamieechlin.atlassian.net/wiki/display/GRV/Script%20Runnerthough

Suggest an answer

Log in or Sign up to answer