Can we subtract the values from the overall Sizing story when the sub-task is cancelled?
In sizing sub-task we have some Numeric custom fields and these fields from all sub-tasks are being rolled up and added at the sizing story level.Now when we say that the sizing sub-task is status is cancelled then can we able to subtract the values from overall sizing story?
Sizing Sub-Task1 Screenshot:-
Sizing Sub-Task2 Screenshot:-
Overall Sizing at the Sizing Story level:-
The status of the Sizing-Sub task is automatically cancelled if we remove the component at the epic level.
Comments (20)
-
repo owner -
reporter They are normal Number Custom Fields.We are just using a Global reflexive transition and we have attached a screen for setting these fields in this transition Post function for rolling up the values at the sub-task level and adding them up at the Sizing story level.
-
repo owner I think that the best way to do it is to replace all the total number custom fields in Sizing Story with Calculated Number Field, available in recent versions of JIRA Workflow Toolbox.
You should use following formulas for the calculated fields:
sum(fieldValue({nnnnn}, subtasks()))
replacing nnnnn with the field code of the field you want to sum up.
This way you can also remove the global reflexive transition, since the values of the fields will be automatically updated, and include the fields in the normal EDIT screen of JIRA.
You should also use a Calculated Number Field for field EGS Effort.
-
reporter we are using global reflexive transitions at the sub-task level just to enter the values in the custom fields at the sub-task level.We are using this because after certain status we are disabling the transition so that these initial fields in the Sizing sub-task are no longer editable.
Now when we cancel the sizing sub-task the values from that particular sub-task should be subtracted from the overall sizing i.e at the sizing story level.
-
reporter Hi Fidel,
Is there any option to change the Data type of the Custom Fields or do i have to delete and re-create them again? Can you please help me with this?
-
repo owner Hi @DineshLoyapalli,
Sorry for the delay in my response. I missed your comments in the issue.
Try replacing term
subtasks(%{00041})
in your formulas for setting parent's fields with this one:filterByPredicate(subtasks(%{00041}), ^%{00016} not in ["Cancelled"])
.Where
%{00041}
is field code for Parent's issue key, and%{00016}
is field code for Issue status.You should to write the name of Cancelled status exactly, i.e., respecting the case. You can check up the name of the status at Administration > Issues > Statuses. I warn you that JIRA UI usually shows status in uppercase.
-
reporter So now i don't have to change the Custom Fields in the Sizing story to " Calculated Number Field"?
-
reporter But for some Sub-tasks the sizing details are already entered and these values are rolled up and added to the sizing story level and now if we cancel the Sizing Sub-task it should subtract the values that we have provided for this particular sub-task from the overall Sizing.
-
repo owner Keep the custom fields as normal number fields. Then change all the formulas in "Mathematical and date-time expression calculator" post-functions at your global reflexive transition replacing term
subtasks(%{00041})
withfilterByPredicate(subtasks(%{00041}), ^%{00016} not in ["Cancelled"])
.After that changes, each time you the transition is executed, the values of parent issue will be recalculated only with the values of non-cancelled sub-tasks.
-
reporter okay got you.Will update and let you know if its working or not.
-
reporter Its not working...Its not subtracting the already added values from the overall sizing at the Sizing story level whenever the status of the Sizing sub-task is cancelled.Its just displaying the same added values even though the status is cancelled.
The status of the Sizing-Sub task is automatically cancelled if we remove the component at the epic level.We have implemented this logic in our previous conversation.
The changes that i have made in the sub-task post functions:-
Thanks...
-
reporter This logic is implemented at the Sub-task level..Once sub-task is cancelled its not going to execute any transition again know.May be that is the reason why its not subtracting the values.Can this logic be implemented at the Sizing Story Level?
-
repo owner Try adding "Copy a parsed text to a field" post-function into transition to Cancelled status in sub-task's workflow with the following configuration:
- Target field: Execute transition (delayed execution)
- Parsing mode: basic
- Text to be parsed...: the name of the global reflexive transition
This way the global reflexive transition will be executed automatically after a sub-task is cancelled.
-
reporter Text to be parsed...: the name of the global reflexive transition
Can I add multiple transitions to it?
Because the values are being rolled up to the story level at two different transitions in the Sizing Sub-task level.
Transitions: 1>Finish Initial Sizing 2>Finish Final Sizing
-
reporter Its not Working....Values are not being updated at the Story level. Here is the Screenshot of the post function that i have added:-
-
repo owner Can you, please, attach an XML export of your sub-tasks's workflow?
-
reporter - attached Is Sizing Sub-Task Workflow.xml
Here is the Sub-Task workflow
-
repo owner Hi @DineshLoyapalli,
"Finish Initial Sizing" is not a global reflexive transition, and thus is not available at Cancelled status.
Please do the following:
- Create a reflexive transition at Cancelled status, i.e., a transition which has Cancelled as origin and destination status. Let's call it "Update Sizing Story".
- Add "Update Sizing Story" all the post-functions you have in "Finish Initial Sizing" and in "Finish Final Sizing" for updating fields in Sizing Story. Don't forget to use the term
filterByPredicate(subtasks(%{00041}), ^%{00016} not in ["Cancelled"])
. - Use "Update Sizing Story" in "Text to be parsed.." as the name of the transition to be executed in "Copy a parsed text to a field" post-function.
-
reporter Thanks Fidel...Its working
-
repo owner - changed status to resolved
Great!
- Log in to comment
Hi @DineshLoyapalli,
Are they normal number custom fields? Please, attach a screenshot of the post-functions you are using for setting those fields.