Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Logs returned when using HAPI

Marko Slijepčević June 19, 2024

Greetings everyone,

I was playing around with the Scriptrunner HAPI syntax and got some logs in the Console log section. What I tried to do is to simply update an Issue and set some values for a multi group picker field, what I got was a correct update on that issue, but Scriptrunner also threw some strange logs. Does anyone know what this is about?

My HAPI code in this example was:

def issue = Issues.getByKey("DEMO-38")

issue.update {

    setCustomFieldValue(12004, "demo-group-one", "demo-group-two")

}
And the log output (exceeding the 300 lines limit, these same lines have been repeated over and over again, when I checked the logs I could find a total of 398 lines with that output):

 

(...)
2024-06-19 15:36:33,385 INFO [security.WorkflowBasedPermissionManager]: LINK_ISSUES granted by permission scheme and workflow perm granting LINK_ISSUES to Group 'jira-administrators'

Start of logs truncated as they exceeded 300 lines.

2024-06-19 15_56_57-Script Console.png


So I went into the Permission scheme of that project, and checked for the Link Issues permission. What I noticed is:

  • 'jira-administrators' have the link issue permission
  • when I remove the group from that permission, the logs do not appear with the next update attempt, the group is not added to the permission (still ok)
  • When I add the 'jira-administrators' group to the permission again, and run the code, the logs happen again

Any ideas what is happening there, and why?

Thanks in advance!

2 answers

0 votes
Reece Lander _ScriptRunner - The Adaptavist Group_
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 20, 2024

Hey @Marko Dev

The logging you see is unrelated to HAPI, you would see the same logging if you used the IssueService class from Jira directly, which is what HAPI calls into.

ScriptRunner will output any logs from the Atlassian application that occur during the script execution. The logs that get shown are a result of the Log4j configuration of the instance.

To quieten down the logs, you will probably want to tweak your Log4j configuration: https://confluence.atlassian.com/adminjiraserver/logging-and-profiling-938847671.html

Make sure to check the docs for your exact Jira version, as newer versions of Jira use Log4j2, and older versions use Log4j 1.

If you need further assistance with this, could you please raise a support ticket with us, so we can give more tailored advice?

Cheers!

Reece

0 votes
Nicolas Grossi
Banned
June 19, 2024

@Marko Dev It is just an info log, maybe someone from adaptavist can give you more details on this.

 

Nicolas

Marko Slijepčević June 20, 2024

@Nicolas Grossi info log yes, but 400? :D

Suggest an answer

Log in or Sign up to answer