I have 3 subtasks (each a different issue type - one of each issue type is in each story), and a 4th issue type of subtasks get added in various quantities on each story.
So let's say, upon transition of subtask issue type #2, I need issue #3 to be created with something showing the sum of all #4 issues within the same story.
Preferrably this number would be in the summary after the standard name, but if i have to make a custom number field, that would be fine too.
Alternatively, this could count the number of issues in Ready status versus count of the issue type, since up to this transition, the previous 3 subtasks would be closed.
*Notes: I've already got #3 creation automation running upon closing #2--just looking for how to update automation to get the sum as described. Also, looking for solutions without scriptrunner or other plugins please.
Thanks in advance for the help!
Hi @Mo
You can do that quite easily using automation in Jira Cloud, by using the Lookup issues action.
The following screenshot shows an example rule which you can run manually against a sub-task.
The {{lookupIssues}} smart value returned by the action is a list and therefore you can run any of the list functions against it; in this case I'm using .size() to count the number items in the list.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mo
Thank you for the question.
I can confirm that to sum up the values on a subtask on a parent issue that we have the example script located in the documentation page here which provides an example of how to store the number of subtasks below the parent issue on the parent issue.
The first way is to use the built-in Create SubTask post function which the plugin provides and is documented here. This post function will create a single subtask when it is executed and so would not be capable of creating a random number of subtasks.
Continue..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The second way to achieve this requirement would be to write your own script and to place this inside Run Script post function which is documented here. This approach would allow you to create a custom script with some logic to create a subtask which could be executed multiple times depending on the number in your multi-select field selected values.
Continue..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mo
Thank you for the question.
I can confirm that to sum up the values on a subtask on a parent issue that we have the example script located in the documentation page here which provides an example of how to store the number of subtasks below the parent issue on the parent issue.
The first way is to use the built-in Create SubTask post function which the plugin provides and is documented here. This post function will create a single subtask when it is executed and so would not be capable of creating a random number of subtasks.
The second way to achieve this requirement would be to write your own script and to place this inside Run Script post function which is documented here. This approach would allow you to create a custom script with some logic to create a subtask which could be executed multiple times depending on the number in your multi-select field selected values.
To do this, you would create a Groovy Times Loop which loops over the number of times as you want to create a subtask for which will be the number returned by the multi-select field and then you can add his logic to create the subtask inside this loop.
I can confirm that to help with approach 2 that we have a script located here which can be run on the Script Console to create a subtask along with some example scripts of how to get custom field values located
here and you will be able to use these scripts to help you create your post function scripts to create subtasks.
One thing to consider with your requirement is that ScriptRunner has a timeout meaning that all scripts must execute within 60 seconds otherwise they will be terminated to prevent causing performance impacts. This means that if you create a lot of subtasks from one post function then you may hit these timeouts.
Thank you.
Kind regards,
Kate
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.