Plugin functionalities are not working with Jira 9

Hi,
We are in the process to support Jira server 9 for our plugin and currently we are facing some issue where the most of the functionalities of our plugin does not work as expected with Jira 9. We have gone trough the release notes as well as the following documents.
https://confluence.atlassian.com/jiracore/preparing-for-jira-9-0-1115661092.html#PreparingforJira9.0-xsrf

We noticed that we have to incorporate some new code changes because of Improved XSRF protection introduced in Jira 9. Initially when we tried our plugin in Jira server 9 we got the 405 error.

Since we are using POST requests in most of our functionalities we have used “@SupportedMethods” implementation as recommended in the above documentations and we were able to resolve the 405 error. But still the functionalities which uses POST requests are not working as expected.
Note: We have used “@SupportedMethods({RequestMethod.GET, RequestMethod.POST})” in both class level and method level.

Our plugin is designed using Velocity template files and we use AJAX calls to execute most of our functionalities. Consider the following simple scenario.

Scenario: We have button which will execute a action in backend and will show a custom message in the UI.

Expected behavior: Button will execute a AJAX POST call which will interact with the action then process some logic and return the response back to the AJAX method. Based on the response we are showing the custom message.

Actual behavior: We can see that the AJAX POST call is getting executed and the request was successful. But the request does not interact with the actual action method (doShowMessage() method). Once we change the request type to GET, the functionality is working as expected.

Please use the sample project to recreate the issue.

Steps to setup:

This sample project contains a simple UI implemented with two buttons which will execute POST requests and will show the response message in a alert() window. When we use POST as the request type, custom messages are not showing. But when we change the request type to GET, we can see the expected custom message shown.

Expected custom messages:
Check Success button → “POST call success”
Check Error button → “POST call success but received an error”

Appreciate if someone could help us to figure out the issue or find a solution.
Thanks!

1 Like

Hi Team, Any update on this?