I have 1 Parent and 1 Subtask, here are the details:
Parent (Project):
Project has a field, named TOTAL BUDGET.
Subtask (PCRF) :
PCRF can be created repeatedly if there are changes from the budget side.
For example: PCRF 1, PCRF 2, PCRF 3 and so on.
**As long as the Parent status is not Completed.
And last, this subtask has a field, named APPROVED BUDGET.
I have the following example cases:
1. The user create the first PCRF subtask, with the value of the Approved Budget field is 100.
PCRF 1.
Approved Budget = 100
Then, after the PCRF status has been Completed, the value of 100 will be stored in the Parent task.
It will be stored in the Total Budget field.
Parent
Total Budget = 100
2. The user create a second PCRF subtask, with the value of the Approved Budget field is 50.
PCRF 2.
Approved Budget = 50
Then, after the 2nd PCRF status becomes Completed, the value of 50 will be summed up with the value in the previous Total Budget field.
(50 +100)
So, the Total Budget field value will automatically become 150.
Parent
Total Budget = 150
The question is, how do we make processes 1 and 2 above run?
What post function do I need?
please help,
Thank you in advance.
Hi @RIZKY JTUASIKAL ,
To achieve the desired solution, you can create a set issue field postfunction on the Complete transition.
then select "Parent of the current subtask" as shown in the below eg:
select the field that you want to update eg: "TOTAL BUDGET"
and then add the below code
{{issue | parentIssue | field("fields.customfield_10055") + issue.fields["APPROVED BUDGET"]}}
note: Please replace the customfieldId_10055 with the customfield id of field "TOTAL BUDGET" and in place of approved budget, please see the correct format, to get the correct format please see the example below.
Please let me know if it worked for you or if you have any questions.
Regards,
Neel
Hi @Neel Mohapatra _Appfire_ ,
I've tried your suggestion, and it worked well.
I have one question,
what is the difference when selecting a field with "Name" or "ID"? is there any different functionality between the two?
And thanks for the help, I really appreciate it. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @RIZKY JTUASIKAL ,
Good to hear that you were able to get it working.
Regarding the diff between ID and Name, There could be two fields with the same name but they are distinguished by customfield id, even in future the field name is changed, the custom field ID remains same.
It is suggested to use the customfield ID instead of the name.
You can get the customfield ID by selecting the ID as shown in the below screenshot.
Regards,
Neel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Neel Mohapatra _Appfire_ ,
thanks for explaining, now I understand the difference.
Thank you very much, Neel
regards
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.