Hello,
I have a numeric Field customised in User Story : Sum _Time -Sub-Task,
this US has N Sub-task.
Every Sub-task has a Numeric Field : Time-Sub-Task
I want to calculate automatically the sum of Time-Sub-Task of the N Sub-Task in Sum_Time -Sub-Task ?
How can I do this ?
Thank You
(Sorry for my awful english, thank you)
You can use Jira Misc Custom Fields plugin and calculate the sub task field value on parent ticket
https://marketplace.atlassian.com/apps/27136/jira-misc-custom-fields?hosting=server&tab=overview
for (Issue subtask : issueObject.getSubTaskObjects()) {
CustomField number=customFieldManager.getCustomFieldObject("customfield_XXXX");
Double numbervalue=(Double)subtask.getCustomFieldValue(amountField);
Sum = sum + numbervalue;
}
Hello,
You would need an add-on for it.
For example, you could use the Power Custom Fields Premium add-on:
You could create a sil custom field with a code like this and add this field to the view screen of the Task issue type:
number sum = 0;
string[] keys = subtasks(key);
for(string key in keys){
#{number field name} = #{number field name} + %key%.#{number field name};
}
This custom field would show the sum of the Number Field custom field for all subtasks of the task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.