Closed ashrafalzyoud closed 2 years ago
Hi,
An issue can have more than one subtask, therefore you should identify more clearly, that what is your intention.
You can summarise the custom fields, if it has number type. If it contains text, then you should make a decision, which subtask data is needed (first or last subtask, or you can concat the strings)
I hope it helps!
task have one subtask custom field maybe text or integer
Hi,
Try this code:
if self == root && root.children?
subtask_cf_value = root.children.first.custom_field_value(1).to_s
end
I hope it helps!
@picman @AirTibu its not working this code
if self == root && root.children?
@issue.custom_field_values = { '1' => self.root.children.first.custom_field_value(1).to_f }
end
im try this code its work for me but i dont know its good or no
What is the field type? Float?
its depend with type cfs
Try this:
if @issue != @issue.root && @issue.root.children?
@issue.custom_field_values = { '1' => @issue.root.children.first.custom_field_value(1).to_s.to_f}
end
error
Workflow script executable before saving observable object contains error: undefined method
children?' for nil:NilClass
`
One of the problem, what I mentioned above: first or last sub task data is needed?
first subtask
the problem in
if @issue != @issue.root && @issue.root.children?
In case of string:
if @issue == @issue.root && @issue.children?
@issue.custom_field_values = { '1' => @issue.children.first.custom_field_value(1).to_s}
end
how i can take cfs[1] from subtask to parent?>