Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I debug ScriptRunner Behaviours?

Magnus Ljungkrantz May 4, 2022

I am looking for a way to debug ScriptRunner Behaviours.

I think I understand how to use the Log4j logs for logging but I am not able to access those log files (is it possible to view them through the browser)?

Another thing I have looked at is the possibility to show logging from ScriptRunner Behaviours in the browser's console (in Developer Tools) as described in

https://docs.adaptavist.com/sfj/improved-front-end-logging-for-scriptrunner-behaviours-94503227.html

I can see messages from the [sr-behaviours] log there but is it possible for me to send my own messages to that log (the one that is shown in the browser)?

I tried adding this code in a Behaviour:

import org.apache.log4j.Logger
import org.apache.log4j.Level
def log = Logger.getLogger("sr-behaviours")
log.setLevel(Level.DEBUG)
log.debug "foo bar"

I see messages like these in the browser console: 

[sr-behaviours] Field: customfield_11611
[sr-behaviours] Field: customfield_11611
[sr-behaviours] Make required: customfield_11611
[sr-behaviours] Require Field: customfield_11611
but my own messages are not seen. Is it at all possible to send my own log messages to the browser console?

Is there any other nice way to debug, i.e. see what happens when it happens?  

1 answer

0 votes
Véronique
Contributor
March 1, 2023

Hi,

Did you end up finding a solution to debug Scriptrunner Behaviours?

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events