Hi,
I'm using JIRA Misc Custom Fields 1.7.0 with JIRA v7.0.0#70107. Always get NullPointerException when I'm trying to issue.get("comment") for a List<> of comments. Full formula is:
<!-- @@Formula:
int numComments = issue.get("comment").size();
if(numComments > 0)
{
return (issue.get("comment")).get(size-1).getUpdated();
}
else
{
return new Date(issue.get("updated"));
}
-->
and eval of first string throws an exception. Issue have several comments. Tried in different ways, results in nothing, so your's advice wanted. Thanks!
This is in fact a bug in JIRA Misc Custom Field 1.7.0 (and 1.6.3). It is tracked at: https://innovalog.atlassian.net/browse/JMCF-196
The bug is already fixed and a new release is on the way.
Sorry for the inconvenience,
David
Version 1.7.1 is released.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm looking into it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And you confirm that issue CUTMAN-5 has at least one comment, right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't get a stack trace but the following messages 2015-11-18 11:42:50,667 http-nio-8080-exec-4 ERROR dmitry.shaidaev 702x2823x2 16k788g 185.36.63.236,185.36.63.206,0:0:0:0:0:0:0:1 /rest/issueNav/1/issueTable [c.i.jmcf.fields.CalculatedDateField] CalculatedDateField: error evaluating formula of field "Last Commented" of issue CUTMAN-5: Sourced file: inline evaluation of: `` int numComments = issue.get("comment").size(); if(numComments > 0) { retur . . . '' : Typed variable declaration : at Line: 2 : in file: inline evaluation of: `` int numComments = issue.get("comment").size(); if(numComments > 0) { retur . . . '' : .size ( ) Target exception: java.lang.NullPointerException: Attempt to invoke method size on null value Navigate to the following URL to edit the formula: https://octonus-teams.com/cutjira/secure/admin/EditCustomField!default.jspa?id=12821 In c:\Atlassian\Data\JIRA\log\atlassian-jira.log
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you post the full error (with stack trace) you found in your log file?
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.