I have what appears to be a relatively straightforward listener:
-----------------------------------------------------
But most of the executions are failing and the information I need is likely truncated away from the top of the log because I get hundreds of "at" messages:
----------------------------------------
at com.atlassian.jira.event.issue.DefaultIssueEventManager.publishEventIfNotificationsAreEnabled(DefaultIssueEventManager.java:180) ~[classes/:?] at com.atlassian.jira.event.issue.DefaultIssueEventManager.publishEvent(DefaultIssueEventManager.java:175) ~[classes/:?] at com.atlassian.jira.event.issue.DefaultIssueEventManager.dispatchIssueEventBundle(DefaultIssueEventManager.java:129) ~[classes/:?] at com.atlassian.jira.workflow.function.event.FireIssueEventFunction.execute(FireIssueEventFunction.java:73) ~[classes/:?] at com.opensymphony.workflow.AbstractWorkflow.executeFunction(AbstractWorkflow.java:1014) ~[osworkflow-2.9.0-atlassian-1.jar:2.9.0-atlassian-1] at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1407) ~[osworkflow-2.9.0-atlassian-1.jar:2.9.0-atlassian-1]
[... many many similar messages deleted ...]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-coyote.jar:9.0.80] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-util.jar:9.0.80] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-util.jar:9.0.80] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:9.0.80] at java.lang.Thread.run(Thread.java:829) ~[?:?]
Start of logs truncated as they exceeded 300 lines.
-----------------------------------------
I found this question that talks about the ScriptRunner version and such:
https://community.atlassian.com/t5/Jira-questions/300-lines-of-error-at-transition/qaq-p/2180085
I have ScriptRunner 8.15.0 and Jira 9.11.2
Any hints?
Thanks, R/ John
You can review the full log by consulting the <jira-home>log/altassian-jira.log file.
You can access that same log using the built-in script "view server log files".
If you want, you can trap your error and then output a manageable number of stack trace messages so don't get flooded.
try {
//all your code here
} catch (e){
def stackTraceIndex = e.stackTrace.findIndexOf{ it.className.contains('groovy')}
if(stackTraceIndex < 1) stackTraceIndex = 20 //default in case we don't find is
log.error e.errorMessage + '\n' + e.stackTrace.take(stackTraceIndex + 5).join('\n')
}
This will only output up to the first line that contains the keyword groovy, or the first 25 lines otherwise.
But it appears that you are just trying to convert the values of a select list into a number.
That can be greatly simplified with HAPI:
def issueTypesAllowed = ['Bug', 'Feature']
if(!issueTypesAllowed.contains(issue.issueType.name) ) return //nothing to do if issue type is not in the list
def selectFielId = 11100L
def numberFieldId = 11801L
def selectValue = issue.getCustomFieldValue(selectFielId)?.value
if(!selectValue) return //no value selected
issue.update{
setCustomFieldValue(numberFieldId, selectValue )
}
This will handle the conversion from String to Double and take care of the history and indexing.
Thank you so much for the wonderful answer! I'll give this a try.
You're correct; that's exactly what I was looking to do.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks very much for this.
I tried the try-catch block, however the rest of the messages continue to blow past the 300-line limit.
Your code at the bottom, though, works perfectly. Definitely simpler than what I had, and clearly more correct, haha!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.