Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Customizing Jira-Plugin trouble


Hi all,

After successfully using Testrail for a couple of months I now feel the need for some customisation of the Jira defects plugin to better fit our Jira, but I miserably fail directly at the beginning following this guide:

I have copied Jira_REST.php to /opt/testrail/custom/defects/Jira_sym.php and changed the class to

class Jira_sym_defect_plugin extends Defect_plugin

The new plugin can be properly selected in the project’s configuration. (It is a test project which is overriding just the defect plugin. Globally I have defined the Jira REST plugin)
When I then go to an existing test run, I get the following error message:

PHP error: Cannot redeclare class Jira_RESTException in /opt/testrail/www/app/plugins/defects/Jira_REST.php at 1874

So I am stuck at the moment and any help is greatly appreciated!




Hey Ben,

Just rename the Jira_RESTException class (and references to it) in your custom defect plugin as well and you can find the definition at the bottom of the file. For example, to fit your naming convention, just do a find & replace on Jira_RESTException to Jira_sym_RESTException.

I hope this helps!



Hi Tobias,

I have changed the exception declaration. Then, another error turned up:

 PHP error: Cannot redeclare class Jira_REST_api in /opt/testrail/www/app/plugins/defects/Jira_REST.php at 937

I have changed that class name as well, and now it appears to work.

EDIT: Renaming Jira_REST_api was not a good idea. Now, when I open the push defect dialog I get:

PHP error: Class 'Jira_REST_api' not found in /opt/testrail/www/custom/defects/Jira_sym.php at 392

So I am afraid, I need some more help,




Hi Ben,

You would need to change all references to the Jira_REST_api class accordingly in your code. E.g. a find & replace in your custom defect plugin just like with Jira_RESTException would do the trick.



Hi Tobias,

Ok, I have missed the reference to that class in the plugin code. Now it is really workng :wink:

Thanks a lot,



Great to hear that, Ben :slight_smile: