Forums

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

Trying to access HttpServletRequest from within custom field plugin in Service Desk customer portal

Matt Flaherty
Contributor
October 30, 2019

Hello,

Apologies if this has already been answered. I'm somewhat new to Atlassian plugin development and could not find a solution. I have written a custom field type plugin for Jira which is being accessed from an issue create/edit screen in the Service Desk customer portal. My requirement is to get hold of the current url query string in order to affect the default value. I had at first tried to do this on the client side, but found that I have no control over the templates in this view. So I'm trying server side. I thought I could get hold of the HttpServletRequest somehow from within the plugin's getDefaultValue method. There are two approaches I've tried, but neither works:

  1. ActionContext.getRequest() - It comes up with the HttpServletRequest in Jira through the CreateIssue.jspa, but inside the customer portal this returns null.
  2. JiraWebUtils.getHttpRequest() - Again, this returns the HttpServletRequest in Jira, but in the customer portal it prevents the page from rendering. I try to step over it in my line debugger and I get dumped into WebApplicationImpl.handleRequest(ContainerRequest, ContainerResponse), for which I have no source. The call stack suggests the thread is running a filter chain.

I feel like I'm chasing a rainbow. Is there a way to do this? Do I need to write my own servlet filter plugin? Any help is much appreciated. Thanks.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events