Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Need to know the file path (in server level) where the Script runner's Script Field are stored

Hello All,

Am trying to sync two environments using CMJ plugin. Where Scriptrunner related Scripts are not copied over from Source to target. I guess i need to manually move the Scripts, Can you tell where the Script Field scripts are stored in the server? So that I can manually copy over them.

2 answers

1 vote

If you open Script Console and then choose the File tab then you will see a help text under the Script text line with the path to the scripts.

Thank you Alexey for your reply. From the Script Console, i can see a <jira-home>/scripts/ as the path mentioned. But when i navigate to the server, there are 0 files in that path <jira-home>/scripts.

Are you sure that there must be scripts? In ScriptRunner you can use inline scripts, which are not saved in the file system.

Go to coq items -> add-ons. Then find Built-In Scripts in the vertical menu and run the Script Registry built-in function. Have a look at what is available.

I can see like they are using Inline Scripts.. :( then no way to move them to another server ?

You need to move only configurations right? If so you can move conditions, validators, post functions with add-ons like Project Configurator or Configuration Manager. All other things you should do manually. That is why I try not to use inline scripts. There are more problems with it than gains.

Inline scripts are fine for the odd little thing that you can easily replicate and for developing them, but for proper scripts, I keep the <jira-home>/scripts directory under source control.

Like Deepak_Murthy likes this

Is there a way to change the path of Inline scripts so that the storage location is changed to some standard file system? How to set the path of the script field storage?

@Nic Brough _Adaptavist_ - Thanks for the suggestion to move scripts to load from files instead of inline. I have more than 150 scripts that are inline and have lost all the scripts a couple of time which has prompted me to move them to individual files and use a source control tool such as Gitlab.

I have a question though - Do you push the code manually to Jira server or have an automated CI/CD pipeline?

I am open to any other suggestions as well.

I am curious as to how you "lost" the scripts - that suggests you're hacking the database or deleting them in the UI.

But keeping them in git is a good plan.  How they're deployed depends on the target system.  I'm old enough to remember the days when we did DevOps without calling it that, and the disasters caused by pushing to production without proper checks - I would never automate a push to production without some preparation and human based gates.  Test - yup, automated push when ready, or even when committed so testing can start as early as possible.

I couldn't exactly determine  what caused the loss of scripts. Strangely it was only scripts defined as a Number Field and this is the second time we have lost them. The first was a few months back and we never figured out why.

The only possible explanations could be two actions were performed in order to solve very slow background reindex times.

Our background reindex times have increased to 15+ hours and our Jira 7.3.3 currently handles:

  • 200000+ issues (one project contains 150,000+)
  • 150+ scripted fields (50 of them pull data from 150,000+ issues)
  • 20+ projects
  • Heavy use of post functions
  • 3000+ custom fields
  • Heavy use of rich filter dashboard
  • 32 Gb physical memory (max pool allocated 12 GB)

But happy to say that I have been able to bring down the reindex time to just under 6 hours after fixing the following:

  • All scripts now error our elegantly (many were returning null and was not handled)
  • Deleted issues that were orphans (a few subtasks without parents)
  • Limited scope of all scripted fields to issue types and projects
  • Post functions scripts that were not in the right order (basically they were before issue update instead of after)

But I still think 6 hours is way too high. A lock and reindex takes only 1 hours but only when turning off Script runner else it just locks up.

scriptrunner_scriptfile_location.PNGHi @Alexey Matveev _cPrime_, I don't see a help box that tells me the file path. Please see my screenshot above.

@Alexey Matveev _cPrime_, nevermind! I followed the link you place on Feb 20.

 https://scriptrunner.adaptavist.com/5.3.6/jira/#_script_roots

I was able to see that when the Scriptrunner plugin was installed the directory called "scripts" was created under JIRA home. 

Sorry to bother you and thank you for your assistance.

It starts with <jira home>/scripts

Suggest an answer

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

Staying organized with Jira: best practices for a better project management

Project managers know this problem: A “mountain of work” lays in front of you, and you don’t know how and where to tackle them. Different to-dos lie ahead, but just one task after the other can be ha...

233 views 2 1
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