Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Other tips for keeping Jira running swiftly

  1. Test scripts out before putting into use - if the script does not perform a batch operation and is not dependent on another system, the script should complete running in milliseconds. If it is a basic script and does not complete after several seconds there could be a problem with the script or with the Jira instance.

  2. Do not use the scheduler too often - the SIL scheduler is really designed to kick off batch jobs during off hours. However, there are many use cases that require the scheduler to be run periodically throughout the day. It is not a good idea to run these jobs too close together because they will keep using the system resources in the background. For example, if a script is scheduled to run every 60 seconds it could be constantly consuming systems resources (memory and processor cycles) and overrunning the Java garbage collection system which would spell bad news for your instance. There is probably a better way to solve the problem than to design an solution like this.

  3. Check your Time to Live settings - there is a self preservation system in place for SIL scripts called Time to Live. If a script gets stuck and runs too long then it will automatically get dropped from Jira and the system will attempt to terminate the thread. Make sure this setting is set appropriately and the system is not waiting too long before trying to kill the script. This setting should be set to the shortest time your scripts allow.

  4. Avoid infinite loops in scripts - an infinite loop can occur easily if you write a script that requires Jira to perform an action in order for the loop to break. For example, the script below requires the status of the issue to be updated before it will stop looping:

    Code Block
    while(status != "Done") {
        autotransition("Done", issueKey, true, true, true);
    }

    But, what if the script is run by a user who does not have permission to transition the issue? Answer, the script will keep running and consuming resources until it is killed. Solution, avoid a script like this at all cost. You will most always find these with 'while' or 'do-while' scripts. If writing the code like this is absolutely necessary (and it can be) it is good practice to put in a safety like this:

    Code Block
    number loopLimit = 0;
    while(status != "Done" && loopLimit < 10000) {
        autotransition("Done", issueKey, true, true, true);
    	loopLimit ++;
    }

    If the action is not completed within 10 thousand loops it probably isn't going to happen at all. A script like this will allow the loop to execute 10,000 times before it stops.

Still having a problem?

Contact support to get more help or even leave a suggestion to be added to this page.