Forums

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

I want see log on click action workflow

kunti pawar June 13, 2018

I want see log on click action I have added 

  • Logging and profiling-com.onresolve.jira.groovy
  • when I am executing below code on script runner then I am getting logs

import org.apache.log4j.Logger
def myLog = Logger.getLogger("com.onresolve.jira.groovy")
myLog.info("Hello kunti from Jira")

  • when I am doing action from ToDo to InProgress then I am geting below error.
  • I have added script post function on In progress

 

2018-06-14 10:49:19,425 http-nio-8081-exec-16 DEBUG 1370585 649x517x1 d3mcp 10.16.2.111 /secure/AjaxIssueEditAction!default.jspa [c.a.util.profiling.UtilTimerStack] [90ms] - /secure/AjaxIssueEditAction!default.jspa
      [86ms] - AjaxIssueEditAction.execute()
    
2018-06-14 10:49:19,426 http-nio-8081-exec-16 DEBUG 1370585 649x517x1 d3mcp 10.16.2.111 /secure/AjaxIssueEditAction!default.jspa [c.a.j.web.filters.ThreadLocalQueryProfiler] RESULT GROUP: OfBizDelegator
2018-06-14 10:49:19,426 http-nio-8081-exec-16 DEBUG 1370585 649x517x1 d3mcp 10.16.2.111 /secure/AjaxIssueEditAction!default.jspa [c.a.j.web.filters.ThreadLocalQueryProfiler]   1:0ms findByPrimaryKey [0]
2018-06-14 10:49:19,426 http-nio-8081-exec-16 DEBUG 1370585 649x517x1 d3mcp 10.16.2.111 /secure/AjaxIssueEditAction!default.jspa [c.a.j.web.filters.ThreadLocalQueryProfiler] OfBizDelegator: 1 keys (1 unique) took 0ms/92ms : 0.0% 0ms/query avg.
2018-06-14 10:49:19,426 http-nio-8081-exec-16 DEBUG 1370585 649x517x1 d3mcp 10.16.2.111 /secure/AjaxIssueEditAction!default.jspa [c.a.j.web.filters.ThreadLocalQueryProfiler] 
2018-06-14 10:49:19,426 http-nio-8081-exec-16 DEBUG 1370585 649x517x1 d3mcp 10.16.2.111 /secure/AjaxIssueEditAction!default.jspa [c.a.j.web.filters.ThreadLocalQueryProfiler] PROFILED : 1 keys (1 unique) took 0ms/92ms : 0.0% 0ms/query avg.

 

1 answer

1 accepted

1 vote
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2018

Hello,

The problem is that you set the Debug level for the whole ScriptRunner plugin. You should define your own logger in your code like this

import org.apache.log4j.Logger
def myLog = Logger.getLogger("com.kunti.pawar")
myLog.info("Hello kunti from Jira")

Now you should go to the Logging and Profiling and set the INFO level for the com.kunti.pawar package. And set the com.onresolve.jira.groovy back to the ERROR level.

kunti pawar June 13, 2018

Thanks lot Alexey :)

this really help me

kunti pawar June 13, 2018

now I am getting error

Could not initialize class org.apache.axis.client.AxisClient

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2018

This error is not connected to the script. I guess, it is some kind of a plugin.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2018

If you feel like your question is answered, kindly accept this answer. In this case other people with similar question can find this answer.

kunti pawar June 14, 2018

I have added all jars which is needed then also I am getting same error

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2018

it is a problem with the org.apache.axis.client.AxisClient. Not all jars can work by adding to the lib path. Once I have added a couple of jars to the lib folder but Jira did not start and I had to bundle this jars to a plugin.

kunti pawar June 15, 2018

Hi Alexey,

I have also tried as per your suggestion till also I am getting same error

(Add Axis.jar at C:\Program Files\Atlassian\JIRA\atlassian-jira\WEB-INF\atlassian-bundled-plugins)

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 15, 2018

I meant I wrote my own plugin and installed my plugin. But you need more work to make ScriptRunner to see the bundle

Suggest an answer

Log in or Sign up to answer