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
4,362,088
Community Members
 
Community Events
168
Community Groups

Script Runner Workflow Validator Inline Script which Table in Database ?

Hi!

Jira Server 8.5.2, Adaptavist Script Runner 6.53.0

We are using Inline Groovy Scripts within Workflow Validator/Post Functions.

From what I read, these scripts are stored in the Database and We need to know where, to find all of them without opening every Validator in every Workflow ...

https://confluence.atlassian.com/jirakb/list-of-jira-server-ao-table-names-and-vendors-973498988.html

This is the link I found, but it doesnt provide what We need.

Thanks in advance for any hint!

Regards,
Hans

2 answers

2 accepted

1 vote
Answer accepted
Antoine Berry Community Leader Aug 08, 2022

Hello @Hans Pesata ,

There is a ScriptRunner feature called "Script registry" that should sum up all the customized scripting you have on your instance : 

image.png

Thanx!

Regards,

Hans

Hi @Hans Pesata 

 

but please remember, that it may take quite a while for alle Script occurrences to load and to be displayed.

 

Cheers,

Holger

Hi @Hans Pesata

first where to find the AO Tables in you running Jira instance:

  1. Please goto the
    1. -> "Admin Section"
    2. -> "System"
    3. -> "Plugin Data Storage"
  2. There you will find all AO tables, regardless if used by an installed plugin or not.
    1. You can search this list for Adaptavist Script Runner and will find those tables:
      • AO_4B00E6_ADAPTA_ANALYTIC
      • AO_4B00E6_SR_USER_PROP
      • AO_4B00E6_SCRIPT_RUN_RESULT
      • AO_4B00E6_STASH_SETTINGS
      • AO_4B00E6_UPGRADE_BACKUP

But this will not help as the Groovy scripts, especially those related to the workflows, are not stored in the AO tables at all.

Some of your scripts may even be found on the filesystem ($JIRA_HOME/scripts)!

Now regarding the scripts stored in the database:

  1. Combination of propertyentry and propertytext:
    • propertyentry.entity_name = 'jira.properties'
    • propertyentry.property_key = 'com.onresolve.jira.groovy.groovyrunner:groovyrunner'
    • propertyentry.propertytype = 6
      • related propertytext.propertyvalue contains groovy code stored as json
  2. Inline Groovy Script in a Jira Workflow:
    • The XML found in jiraworkflows.descriptor contains everything related to e.g. conditions, validatos and postunctions as well as configurations, steps and transitions.
      • In this XML you will find XML Elements "arg" with the "class.name" set to e.g. "com.onresolve.jira.groovy.GroovyFunctionPlugin
        " and a second Element "arg" with the "name" attribute set to "FIELD_INLINE_SCRIPT". The CDATA section of those contain the inline script.
      • In case you only find an Element "arg" with a "name" set to "FIELD_SCRIPT_FILE" there is another "arg" with the name "script FileName" that points to the file on disk

 

I hope this helps and before you ask, yes, it is possible to do this in a Groovy Script from the running Jira instance instead of trying to piece together the info from the database.

Cheers,

Holger

Thanx for the valueable Information!

regards,
Hans

Like Antoine Berry likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

214 views 1 6
Read article

Atlassian Community Events