borrowing some code from https://github.com/MedicoreNL/JiraApiBundle