I want to create a set of sub-tasks when a particular transition occurs.
For example, when an issue moves from To Do status to In Progress status, I want to automatically create a couple of sub-tasks.
I only want this to happen once, though - just the first time the issue is transitioned.
I think this is possible with Automation for JIRA (Cloud version), but what is the best way to implement?
Thanks
Hi Sam,
I'm one of the creators of Automation for JIRA and you can certainly do this. Here's what the rule needs to look like:
conditionally-create-subtasks.png
Lets break this down:
We use a compare two values condition to check if the status has changed from a particular old value to a new value using this smart-value:
{{#changelog.status}}{{fromString}} > {{toString}}{{/changelog.status}}
Detecting the status change is a bit complicated still, but we'll ship a new trigger in the next couple of days, that will make this even easier! It will allow you to run a rule whenever any issue field value changes (including status).
Just to let you know - the new trigger I talked about in my answer above is now available in production as well. You can see an example here: https://blog.codebarrel.io/automatically-update-issues-when-a-jira-issue-field-value-changes-d932f3ea6f0f
Makes it a bit easier to trigger a rule when the status changes!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sam,
Disclaimer I work on ScriptRunner for JIRA Cloud.
This is exactly the kind of use case ScriptRunner for JIRA Cloud is designed for. You could use a Create Subtask Post Function (http://scriptrunner-docs.connect.adaptavist.com/jiracloud/post-functions.html#_create_subtask) with a condition on the number of subtasks the issue has.
Regards, Jon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jon. I'll give it a try and see how it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sam / Jon,
Did you succeede to create a sub-task with this solution?
I did not find the Create Subtask Post Function in Jira Cloud.
Thank you,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Leo,
When editing your workflow transition, and on the "Post Functions" tab, click "Add post function".
On the next screens which shows you a list of Post Function types, choose "ScriptRunner Post-Function" and click "Add".
On the next screen you can see a list of predesigned post function templates. One of them is:
---
Creates a configurable subtask
---
You can define a Condition that would allow/disallow the post function to fire, as well as define the field data for the subtask such as the "Summary".
Within the additional section is a code-editor for any more advanced use-cases. From there you can click on any of the examples to paste that code into the editor for your ease of use.
Lastly, you can also read more on how to work with post functions on our documentation page here: https://scriptrunner-docs.connect.adaptavist.com/jiracloud/post-functions.html
This page also goes into more detail regarding the "Create Subtask" post function.
Hopefully this helps!
Many thanks,
Ryan
Product Manager - ScriptRunner for Jira Cloud
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sam, There is an add on for multi sub task creation in market place. Once installed, you can see that as part of your post function for your transitions while editing your workflow. Edit the transition for 'To Do', click on Post Functions tab, use the multi sub task utility to define your sub task attributes, publish the updated workflow. Now when you move the issue from To Do status to In Progress, your sub tasks will be automatically be created. You can see them in your issue detail screen. Good luck.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Guhan. What's the add on called?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sam, I used JIRA Suite Utilities (JSU) long time back. I could see that it is not supported by Atlassian anymore, but the functionalities are there in Bobs Issues on Transition related add on too. Market place may have the latest ones and hope you can find one suitable for your environment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there any way I can achieve a simple feature like assigning sub-task automatically to the main-task assignee, without having to buy a plugin from market place ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.