JsonMarshallingException when using scripted field on view screen


we have a scripted field on a view screen that calculates the centralized release version based on the version entered in the issue.


def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def searchProviderFactory = ComponentAccessor.getComponent(SearchProviderFactory)
def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
def searchProvider = ComponentAccessor.getComponent(SearchProvider)
def issueManager = ComponentAccessor.getIssueManager()

def customFieldManager = ComponentAccessor.getCustomFieldManager();
CustomField managedRelease = customFieldManager.getCustomFieldObject("customfield_11801");

def builder = JqlQueryBuilder.newBuilder().where().defaultOr()
def clauseBuilder = JqlQueryBuilder.newClauseBuilder().defaultAnd()

if(issue.getFixVersions() == null || issue.getFixVersions().size() < 1)
	return "";


def query = builder.buildQuery()
def result = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter());

if(result.getIssues().size() > 0)
	return result.getIssues().get(0).getCustomFieldValue(managedRelease);
    return "";

the script works fine, it executes without errors. However when creating a new issue, Jira 7.3.5 (previously 7.1.9 worked fine) throws the following exception


com.atlassian.plugins.rest.common.json.JsonMarshallingException: org.codehaus.jackson.map.JsonMappingException: No serializer found for class com.atlassian.jira.issue.customfields.option.LazyLoadedOption and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: com.atlassian.jira.quickedit.rest.api.field.QuickEditFields["createdIssueDetails"]->com.atlassian.jira.rest.v2.issue.IssueBean["fields"]->java.util.HashMap["customfield_12601"])
 at com.atlassian.plugins.rest.common.json.DefaultJaxbJsonMarshaller.marshal(DefaultJaxbJsonMarshaller.java:57)


the mentioned custom field is the ID of the scripted field above.

We have no searcher configured as it is only a display field. Is there any way to avoid the exception?

1 answer

Hi Stefan,

I have been looking into your issue, and I have tried your script on Jira version 7.3.5 and it seems to run without porblems. I do have some questions that might help get to the bottom of your issue.

You mentioned "the mentioned custom field is the ID of the scripted field above.", however if I set the custom field ID to that of the scripted field (CustomField managedRelease = customFieldManager.getCustomFieldObject("customfield_11801")), I get a StackOverflow error because essentially the script is retrieving its own value. It works for me when I reference a different (text field) custom value on that line instead. Can you maybe provide me with a screenshots of your custom fields, or confirm which field this ID should be?



Hi Stephen,

thank you for checking this out.

My script is looking for an issue of type "Managed Release"


which carries a custom field called managed release version (11801)

The scripted field 12601 is essentially a script that displays the custom field value in all issue that carry a fixversion that corresponds to the fixversion of the Managed Release issue type.

best regards


Hi Stefan,

Try return a string instead, so in your return line 

    return result.getIssues().get(0).getCustomFieldValue(managedRelease)?.toString()

Let us know if this fix the issue.

Hi Thanos,

I have stumbled on similar bug and result.toString() solved problem.

Thanks, Jozef

Hey Jozef, thanks for letting us know :)

cheers, Thanos

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


199 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you