Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Where is the value of a scripted field stored

francis Marketplace Partner Sep 03, 2013

We would like to create a query on the database involving the customfieldvalue of a scripted field, but apparently it is not stored there.

Where should we find it (if at all persisted)

1 answer

1 accepted

2 votes
Answer accepted

I seem to remember that scripted fields store their results data in the index. (I know that's how derived fields do it, but I could be wrong about scripted fields and they build it on-the-fly whenever it's needed)

I'm afraid that if you're reporting off the database, then the only real answer is to duplicate the work the scripted field does in your reporting.

Yep... if you need a second opinion, Nic is correct. Scripted fields extend Calculated Fields, which have no value in the database.

You can export all to excel and do your aggregate calculation in that, or write a raw lucene query and do some calculation on those results...

It is possible to retrieve sript code from database? Where Script Runner store script code?

Like Raul Pelaez likes this

It's important to know how the code of the script field is stored in Jira because there is a bug that after Jira reindex sometimes all code source of Scriptfields dissappears and it's very annoying and ugly

If you're randomly losing scripts like that, you need to be looking at the rogue application or script that is trashing your data, not patching over it by taking backups and manually re-entering scripts.  Neither Jira nor Scriptrunner have code that would delete scripts during indexing.

They're held in the AO tables that SR adds to Jira when you install it.

I think I can reproduce the bug if I change the code of some script field during a hard index of Jira. Is possible?

Thanks Nic

I do not know - I've never seen that happen before, without someone tinkering in the database.

I remember see a similar bug if you edit two script fields at same time (in different tabs in browser). Is possible?

Suggest an answer

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

Marketplace Partner Spotlight: AppLiger

This month the spotlight is on AppLiger. We caught up with Pavel Pavlovsky, CEO and Product Manager, to learn how the company started and what fuels the team's creativity.    Atlassian:...

379 views 0 7
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