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

Search through ScriptRunner scripts?

Jacques B July 13, 2022

Is there a way to search through all ScriptRunner scripts to see if they contain a string value?

 

I've noticed that a previous developer hard-coded field values in some scripts. I need a way to ensure I do not break legacy code if I change the values of a Select List (single choice), for example.

 

 

2 answers

1 accepted

1 vote
Answer accepted
Jacques B August 4, 2022

I logged a ticket with Adaptavist, see response below:

https://productsupport.adaptavist.com/servicedesk/customer/portal/23/SRJCLSUP-4896

Andrea Pannitti
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.
August 4, 2022

Hi @Jacques B ,

can you report here the response because I haven't permission to view this request?

Thank you

Jacques B August 4, 2022

Hi @Andrea Pannitti , below is the response from Adaptavist Support.

 

Than you for creating a support ticket with our team,

Unfortunately on ScriptRunner for Jira Cloud there is no straight forward way to achieve this, as we do not currently provide a report to generate a list of all these scripts and configurations in one central place as we do in the Server version with the Script Registry built-in script that it provides.

This means that the only way to get this information is to manually review your instance in order to check every location where you can configure the features provided by ScriptRunner.

Listed below is every location that you will need to check in order to be able to document all of these scripts. Please note for point 6 we have created a new Workflows page and on this, you will be able to click the ... icon next to each item and then edit it from this page in order to view the script inline which will save you some time as you won't need to need manually load and navigate through each workflow.

Steps to find out where ScriptRunner for Jira Cloud Scripts and Configuration is used:

  1. Script Listeners: - I can confirm that you will be able to see all Script Listener Scripts which have been configured in the cloud instance by navigating to the URL of <JiraBaseURL>/plugins/servlet/ac/com.onresolve.jira.groovy.groovyrunner/script-events-admin?s=com.onresolve.jira.groovy.groovyrunner__script-events-admin and this page will show any scripts that you have configured so that you can document these for your new developer.
  2. Script Fragments: I can confirm that you will be able to see all Script Fragment Scripts which have been configured in the cloud instance by navigating to the URL of <JiraBaseURL>/plugins/servlet/ac/com.onresolve.jira.groovy.groovyrunner/script-fragments?s=com.onresolve.jira.groovy.groovyrunner__script-fragments and this page will show any scripts that you have configured so that you can document these for your new developer.
  3. Scheduled Jobs: I can confirm that you will be able to see all Scheduled Jobs Scripts which have been configured in the cloud instance by navigating to the URL of <JiraBaseURL>/plugins/servlet/ac/com.onresolve.jira.groovy.groovyrunner/scheduled-jobs?s=com.onresolve.jira.groovy.groovyrunner__scheduled-jobs and this page will show any scripts that you have configured so that you can document these for your new developer.
  4. Escalation Services: I can confirm that you will be able to see all Escalation Services Scripts which have been configured in the cloud instance by navigating to the URL of <JiraBaseURL>plugins/servlet/ac/com.onresolve.jira.groovy.groovyrunner/escalation-service?s=com.onresolve.jira.groovy.groovyrunner__escalation-service and this page will show any scripts that you have configured so that you can document these for your new developer.
  5. Enhanced Search Queries: I can confirm that we do not provide a way to see all enhanced search queries that have been created in one place which means that you will need to ask users to tell you any queries that they have created
  6. Workflow Post Functions, Conditions and Validator: I can confirm that you will be able to see all the Workflow Post Functions, Conditions and Validator which have been configured in the cloud instance by navigating to the URL of <JiraBaseURL>plugins/plugins/servlet/ac/com.onresolve.jira.groovy.groovyrunner/workflows?s=com.onresolve.jira.groovy.groovyrunner__workflows*and this page will show any scripts that you have configured so that you can document these for your new developer.

We have a public-facing feature request to create a report to show where all scripts are used inside of our backlog here and I would ask you to vote on this request if you believe that is useful to your company. 

1 vote
Andrea Pannitti
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.
July 13, 2022

Hi @Jacques B ,

you could call this rest in POST:

/rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.jira.admin.ScriptRegistry

and then search your string in the json response.

Or, alternatively, look directly into the ScriptRunner Registry. You can found it in ScriptRunner Settings clicking on 3 dots.

Jacques B July 13, 2022

Hi @Andrea Pannitti 

Thanks for the response.

I tried the request with Soap UI, but get a 404. Is there something obvious I'm doing wrong?

2022-07-14 08_03_35-SoapUI 5.7.0.png

Andrea Pannitti
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.
July 13, 2022

Hi @Jacques B,

sorry, only now I noticed you're on cloud and my solution is for server or data center.

Like Jacques B likes this
Hua Soon SIM _Akeles_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
February 22, 2024

Thank you @Andrea Pannitti 

That is a useful trick for troubleshooting broken scripts.
I can search the error message within all the scripts at one go :D

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events