Where is the value of a scripted field stored

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
September 3, 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
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 3, 2013

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.

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2013

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...

Roberto Marquez Bittencourt July 19, 2018

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

Raul Pelaez _TecnoFor - Marketplace Partner_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 23, 2020

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

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 23, 2020

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.

Raul Pelaez _TecnoFor - Marketplace Partner_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 23, 2020

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

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 23, 2020

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

Raul Pelaez _TecnoFor - Marketplace Partner_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 23, 2020

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
TAGS
AUG Leaders

Atlassian Community Events