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

Script Runner Workflow Validator Inline Script which Table in Database ?

Hans Pesata August 7, 2022

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

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 8, 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

Hans Pesata August 8, 2022

Thanx!

Regards,

Hans

Holger Lehmann [catworkx GmbH] August 8, 2022

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

1 vote
Answer accepted
Holger Lehmann [catworkx GmbH] August 8, 2022

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

Hans Pesata August 8, 2022

Thanx for the valueable Information!

regards,
Hans

Like Antoine Berry likes this
TAGS
AUG Leaders

Atlassian Community Events