hello, in one transition i am setting value of "last time duration" (in minutes, i.g. 10) and i would like to update Calculated Number Field "TOTAL" - add last time to TOTAL ... but when i reffer in formula to itself, it doesnt work ...
<!-- @@Formula: (issue.get("customfield_10600") != null ? issue.get("customfield_10600") : 0) + (issue.get("customfield_10602") != null ? issue.get("customfield_10602") : 0) -->
//id of TOTAL is 10602, id of last time is 10600 ...
thank you
ok, i figured it out:
i have Calculated Number Field called "Total time" from plugin JIRA Misc Custom Fields. Next i have Number field "null" and Number field "last time". In transition "Add last time duration to total time" i am entering value in field "last time". In create transition i am copying valu from "total time" to "null" ---- this is my way of setting null field to value 0, because calculated number field has default value 0 if all others fields are ot defined, that i am add together in description of the Calculated number field. Next i am using number field "last value".
Description of "total time":
<!-- @@Formula: (issue.get("customfield_10600") != null ? issue.get("customfield_10600") : 0) + (issue.get("customfield_10604") != null ? issue.get("customfield_10604") : 0) -->
//id for "last value"=10600, id for "last time"=10604
The clue to achieve the result (to add a value to total counter) is in transition BEFORE entering value of "last time" execute this copying: last value := total time AND last time:= null.
Simply solutions are the best :)
Hi Peter Novak,
I have still not figured out the issue, I am doing exactly same given by you.
Regards
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
you need three variables: variable "null" with value 0, variable "old_value" and variable "add_this_value" -- these variables are Number Fields. Now you need Calcuted Number field "Total". In description of "Total" type:
<!-- @@Formula: (issue.get("customfield_10600") != null ? issue.get("customfield_10600") : 0) + (issue.get("customfield_10604") != null ? issue.get("customfield_10604") : 0) -->
10600 is ID for field "old_value" and 10604 is ID for field "add_this_value".
1. in create transition use post script Copy value from Field to Field and copy value from "Total" to "null"
2. Now say, you are entering value for field "add_this_number" via screen in "transition1". Before traansition1 you need to add post script (to transition0) that will Copy value from Field to Field: old_value := Total AND add_this_value := null;
And thats it :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
and please can you try to give me a hint, how to manage scripting to achieve my goal? this is blocking issue for me right now ...
on some screens (screens associated with transitions between states) i can enter a value for "last duration" and after submitting the screen, i want to add this value to TOTAL duration field ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i'm familiar with groovy scripted fields: https://studio.plugins.atlassian.com/wiki/display/GRV/Scripted+Fields#ScriptedFields-Calculateanumberbasedonotherfields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
are you familiar with some other plugin, to get the correct result? sollution, when i need t add one number to total count? thx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK... sorry, not familiar with that plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
p.s.: "but when i reffer in formula to itself, it doesnt work ..." - the resulted value is much more greater than expected, when i am reffering to the same field: A = A + B (A is reffering to itself)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi jamie, i am using
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are using some plugin, but which one? What language is that?
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.