Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira Scripted Field Indexing Error Edited

Hi, I have a scripted field in place where I want to count the number of days for an issue to get to Resolved/Closed.

Below is the script and the error.

It looks like a type incompatibility. How can I fix this? Thanks

Scripted Field 

image2015-12-14 15:11:36.png

image2015-12-14 15:12:13.png

Error

 

2015-12-14 14:48:48,341 http-bio-8080-exec-4 WARN bakshia475 888x232571x1 euy03p 10.176.19.105,127.0.0.1 /secure/AjaxIssueAction.jspa [jira.issue.index.DefaultIssueDocumentFactory] Error indexing issue DEP-2318: Dropping 'customfield_15416'
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Double
        at com.atlassian.jira.issue.index.indexers.impl.NumberCustomFieldIndexer.addDocumentFields(NumberCustomFieldIndexer.java:47)
        at com.atlassian.jira.issue.index.indexers.impl.NumberCustomFieldIndexer.addDocumentFieldsSearchable(NumberCustomFieldIndexer.java:34)
        at com.atlassian.jira.issue.index.indexers.impl.AbstractCustomFieldIndexer.addIndex(AbstractCustomFieldIndexer.java:46)
        at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory$Builder.add(DefaultIssueDocumentFactory.java:102)
        at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory$Builder.addAll(DefaultIssueDocumentFactory.java:91)
        ............................................
............................................
2015-12-14 14:48:48,420 http-bio-8080-exec-4 WARN bakshia475 888x232571x1 euy03p 10.176.19.105,127.0.0.1 /secure/AjaxIssueAction.jspa [jira.issue.index.DefaultIssueDocumentFactory] Error indexing issue DEP-2318: Dropped: [customfield_15416]

 

 

1 answer

Hi 

Try to move the as Double outside the parenthesis. For example 

return Math.round(timeDiff/(1000*60*60*24)) as Double

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

5 mobile apps for Jira Cloud to boost productivity

  It’s very important to have access to the workflow process from anywhere. Especially if you manage the work of others. There is no difference whether you’re out of office, or drive a ca...

260 views 2 5
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you