Is it correct that Adaptavist wraps the Jira Java classes with groovy classes?

Hi, I am starting with groovy in Script Runner and a few things are unclear. Can I use this thread for further questions too? smile

3 answers

It is correct since groovy is extension for Java.

Ask further questions.

1 vote

The classes in ScriptRunner are just the original Atlassian JIRA Java classes which you can use with Groovy. So you have full access to all the methods you do on the Atlassian JIRA API. There is no special "wrapper" around them.

For example issue is just this

For the double logging, it looks like both the root logger and the new logger you have setup are logging. In your can you add this to see if this solves the issue:

I followed the tutorial for setting up the dev environment. Everytime I log.debug something I get the message twice:

2016-02-25 10:06:54,190 http-nio-8080-exec-24 DEBUG 606x4798x1 1i3lirg /rest/api/2/issue/10000/comment [c.o.scriptrunner.runner.ScriptRunnerImpl] My instance contains 1 users

2016-02-25 10:06:54,190 http-nio-8080-exec-24 DEBUG 606x4798x1 1i3lirg /rest/api/2/issue/10000/comment [c.o.scriptrunner.runner.ScriptRunnerImpl] My instance contains 1 users

Any Idea why?

Hmm, strange, now I don´t get debug messages at all, even after I changed it back.

Ok, I get one debug now, which is good, but if I put log.debug in a class nothing is logged. Why is that?

That´s weird, I got an email, but your answer isn´t shown here.

I wrote a SendEmail class, in a send method I´ll do log.debug "something" and that debug message is not shown in the log. If I do log.debug in the class calling script I can do log.debug, but not in the imported class.

Hi Marc, add the following to your class:

class SendEmail {
	public void send() {

Can you set the logging level to debug in the script console by doing:

Then run your script.

Or do log.warn instead.

Hmm, still no debug in classes.

Is that a one time thing or should I put it in my script too?

You need to change the package the script is under to "com.onresolve" or do:

@Log4j(category = "com.onresolve.somepackage")
class SendEmail {
    public void send() {

Its probably easier to use a higher logging level like log.warn.

To sum this up, we solved it by adding:

log4j.logger.library = DEBUG, console, filelog

log4j.additivity.library = false

to the file

Ok, next question:

The classes I fetch from ComponentAccessor, is that always a new instance or an instance that JIRA already uses at that moment?

I want to extend the CommentManager, is that doable by changing the factory or do I have to instatiate it with all it´s dependencies?


Can you ask a new question please, answering a question with a new question makes it hard for people to use this as a resource.

Aw, Jamie! But I love using tools where I can squish all the information is in a single long running thread. Email just roolz ;-)

Sure, no problem :=)

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

361 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you