Forums

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

Help to getRequest() in Confluence 10

Normann P_ Nielsen _Netic_
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 Champions.
March 26, 2026
In Confluence 9 I have working:
// Get request and retrieve IP address
def request = (new StaticHttpContext()).getRequest()
def remote = request?.getHeader("X-FORWARDED-FOR")
if (!remote) {
remote = request?.remoteAddr
}
This fails for Confluence 10:
Event listener failed: event: com.atlassian.confluence.event.events.content.page.PageViewEvent, id: 851255bb-6d07-47e5-bcfe-cd42e59f743a, script notes: Post Events to splunk.netic.dk groovy.lang.MissingMethodException: No signature of method: com.atlassian.confluence.web.context.StaticHttpContext.getRequest() is applicable for argument types: () values: [] at dk.netic.groovy.post2splunk.run(post2splunk.groovy:23)
So I need the new way to get the Request. 
Goal: Get souce IP of the Request via the X-FORWARDED-FOR header

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events