How to access page source code of pop ups in jira using servlet filter or any other alternative

Hi All,
I m working on developing a jira plugin which should allow modification to custom fields on all screens(Create, View, Edit). Currently, I m able to intercept the requests to view screen and able to modify page source(updating custom fields visibility) using servlet filter. This is working fine on view screen.

I m facing problem in doing the same for Edit screen. I m not able to intercept requests which are triggered when we click on edit button.

Following is the URL which is accessed when we click on edit in a jira issue

http://localhost:2990/jira/secure/QuickEditIssue!default.jspa?issueId=10000&decorator=none

Things I tried-

I have added multiple url patterns in the servlet filter as below,

<servlet-filter name="Filter Servlet" key="modifyResponseFilter" class="com.myplugin.filter.ModifyResponseFilter" location="before-decoration" weight="200">
         <description>Servlet for modifying the response</description>
         <url-pattern>/browse/*</url-pattern>
         <url-pattern>/QuickEditIssue</url-pattern>
         <url-pattern>/QuickEditIssue/*</url-pattern>
</servlet-filter>

The above works fine for view screens. (its able to intercept view screens which are access with /browse/* urls)

How to intercept requests for modifying data on ‘pop up’ screens like Edit in Jira?How to modify page source of pop ups in jira? What is the right and efficient way to do it?

I m new to Jira plugin development and It will be very helpful if you can guide me around possible approaches which will work on Pop up screen. Feel free to suggest any other alternatives as well.

Thank You.
Vishal K

I would not recommend using Servlet module for this, as it might cause unexpected behaviour of your Jira instance. Whenever a there are conflicting Servlet URL filters in a Jira system, Jira will be using the one that is loaded either first or last (can’t remember which). You are basically building your app on a race condition during Jira start up.

The best way to manipulate page source in Jira Server/DC is to use client-side code (Javascript). You can use contexts to make sure that your code is executed when the appropriate screens are shown.

Using Javascript, you can alter the page view to your desire as you have full access over the browser DOM in Jira Server/DC.

Thank you @remie for the quick response and guiding me in the right direction. I agree with your point that Jira might have default servlets which may conflict with my servlet with same url pattern and will result into race condition. Is there any way to get a list of default servlets which Jira already uses or activates during starting up?

With reference to context, are you referring the servlet context or web resource context?

https://developer.atlassian.com/server/framework/atlassian-sdk/servlet-context-listener-plugin-module/
https://developer.atlassian.com/server/jira/platform/web-resource/#WebResourcePluginModule-WebResourceContexts