Hello Jamie,

I would like to add a scripted field to a project that sum the number of selected values in a multi-select list custom field.

 

I create a scripted field with the below code: 

return ((getCustomFieldValue(10528)?.size())?:0) as Double

 

and I am getting the below:

The indexer for this field expects a java.lang.String but the script returned a java.lang.Double.

Any help plz ?

1 answer

0 vote

Hey Nadim!

It seems you may have to change the type of the indexer for your scripted field. To do that, just go to the Add-ons tab in JIRA's Administration panel and look for Script Fields under the Script Runner section on the sidebar of the page. On there, click the Edit button on the upper-left corner of the field description and check what you have defined as Script Template and Configured searcher, that are located right below the big field for inserting the script on the page.

 Scripted_Field.jpg

To work with Double data type, you may select the Number Field  as the Script Template and also change the Configured searcher as Number Searcher.

I also tagged your question with the one monitored by the Script Runner plugin developers, so that they can also help you if what I suggest doesn't resolve the issue you are having. (surely they know much more about it than me...) wink

 

Cheers!

Joao

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

Mission-critical battery manufacturer fulfills FAA software requirements with Commit Policy Plugin

EaglePicher Technologies is a leading manufacturer of battery systems for diverse industries like defense, aviation, space or medical. As they operate in highly regulated industries, keeping a clear ...

165 views 0 2
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