Hi All,
I have a problem as following, any help will be appreciated..
I opened a bunch of calculated custom fields and configure those custom fields like following;
Issue type(s):Global (all issues)
Project(s): Demand
And also hide those custom fields from other projects field configuration scheme's.
When I look into logs, I see errors besides from demand project like xxx named project..
One of example: (ASK project for this error)
172.16.1.15 /secure/admin/jira/IndexReIndex.jspa [innovalog.jmcf.fields.CalculatedNumberField] CalculatedNumberField: error evaluating formula of field "Iptal Onayinin Verilme Süresi Gün" of issue ASK-472:
Sourced file: inline evaluation of: `` if (issue.get("resolutiondate") == null) return null; return ((Double)(issue. . . . '' : at Line: 3 : in file: inline evaluation of: `` if (issue.get("resolutiondate") == null) return null; return ((Double)(issue. . . . '' : .getTime ( )
Target exception: java.lang.NullPointerException: Attempt to invoke method getTime on null value
Navigate to the following URL to edit the formula: htt/secure/admin/EditCustomField!default.jspa?id=12521
I want to eliminate those errors. What should I do ? Regards, Levent..
Are you using JMCF 1.7.2? Because with that version, calculated fields should not evaluate the formula for issues that don't match any configured context for the field.
In any case, you should also test customfield_12519 for null values before calling .getTime() on its value.
You need to amend the script so that it does not try to run if the resolution date field is empty.
If you can share the script with us, we can probably help you correct it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
I am already doing it. My code is below:
<!-- @@Formula:
if (issue.get("resolutiondate") == null) return null;
return ((Double)(issue.get("resolutiondate").getTime() - issue.get("customfield_12519").getTime())) / 1000 / 3600 / 24 -->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The formula does not give an error.
The error is: The customfield is trying to calculate this in other projects which is inconvenient. I need to avoid calculating for other projects besides from my Demand Project..
Any ideas ??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The formula won't give you an error itself, as the code looks ok. But I suspect the issue.get in line 1 is failing, not returning a null, and hence it never evaluates it and then moves on to the next line where it promptly fails as well.
If you don't want it to run in certain projects, change the scripted field context so that it only exists in the projects you need it in.
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.