Hi
i am using jira misc custom field, So code is needed to find the difference between two number custom field.
i have 3 custom field of number field(time estimated,time consumed and time remaining)
so when ever i enter the time estimated and time consumed ,automatically time remaining must be calculated(i.e time estimated-time consumed=time remaining)
Regards,
Abhishree nagesh
There is an example here in the documentation for addition, I think you can use the same for subtraction.
https://innovalog.atlassian.net/wiki/spaces/JMCF/overview#JIRAMiscCustomFields-calculatednumberfield
Keep in mind that for time you might have to alter the formula a bit since Jira counts in milliseconds
Hi,@Patrick Cartier [Candylio]
I have tried the same code for finding the difference, which is suggested in the document but it's not working.
So kindly help me with the relevent code.
Regards,
Abhishree Nagesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your quick replay but the code is not working for addition also.
Regards,
Abhishree Nagesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please show me what you have so far and I will take a look.
edit: also please make sure that the two source fields are number fields if you are using a "calculated number field" in the resulting field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have used the below code, with respective custom field ID's of time estimated and time consumed and updated in description of the calculated number field (remaining time) and trying to extract from the gadget using board filter.
(issue.get(
"customfield_10114"
) !=
null
? issue.get(
"customfield_10114"
) :
0
) + (issue.get(
"customfield_10150"
) !=
null
? issue.get(
"customfield_10150"
) :
0
)
Regards,
Abhishree Nagesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The formula looks good. Three possible situations I could think of:
1. are the two fields of time estimated and time consumed number fields?
2. Don't forge to add "<-- @@Formula:" before and "-->" after
3. Make sure you are putting the formula in the description of the calculated field, not the description of the field configuration.
Should look like this in the end (depending on your custom fields):
<--@@Formula: (issue.get(
"customfield_10114"
) !=
null
? issue.get(
"customfield_10114"
) :
0
) + (issue.get(
"customfield_10150"
) !=
null
? issue.get(
"customfield_10150"
) :
0
) -->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Yes, time estimated and time consumed are the number field.
2. i have put the code as shown with respective custom id's.
3. i have put the code in description of calculated field.
but its not working.
Regards,
Abhishree Nagesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your time, the other code from the document has worked.
Regards,
Abhishree nagesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This formula works for me. Without seeing screenshots or anything else I can't help you. Sorry.
<!-- @@Formula:
( issue.get("time estimated") != null ? issue.get("time estimated") : 0 ) -
( issue.get("time consumed") != null ? issue.get("time consumed") : 0 )
-->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.