RPC: request rejected (bad origin): error on plugin

Hi, I develop a plugin for issue page. In the plugin I am making a rest api call to jira server rest api to get boardId which issue’s sprints belongs to. It worked on my local jira but when I deploy plugin to my companie’s jira, issue page shows a blank screen and in the browser console I see this error:
So I had to disable plugin.

RPC: request rejected (bad origin): https://jtracker.company.com

import com.google.gson.Gson;
import com.trendyol.testManagementPlugin.model.SprintSummary;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.stream.Collectors;

public class JiraRestApiClient {

    private final Gson gson;
    private final String token;
    private static final Logger LOG = LoggerFactory.getLogger("atlassian.plugin");

    public JiraRestApiClient(String token) {
        this.gson = new Gson();
        this.token = token;

    public Integer getBoardIdBySprintId(long sprintId) {
        HttpURLConnection connection = null;

        try {
            String baseUrl = "https://jtracker.trendyol.com/rest/agile/latest";
            URL url = new URL(baseUrl + "/sprint/" + sprintId);
            connection = (HttpURLConnection) url.openConnection();
            connection.setRequestProperty("accept", "application/json");
            connection.setRequestProperty("Authorization","Bearer "+ token);
            try (InputStream inputStream = connection.getInputStream()) {
                String responseText = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))
                if (connection.getResponseCode() == 200) {
                    return extractBoardIdFromResponse(responseText);
                } else {
                    LOG.error("Status Code: {}. Reason: {}", connection.getResponseCode(), responseText);
                    return null;
        } catch (IOException e) {
            return null;
        } finally {
            if (connection != null) {

    private Integer extractBoardIdFromResponse(String responseText) {
        SprintSummary sprintSummary = gson.fromJson(responseText, SprintSummary.class);
        return Integer.parseInt(sprintSummary.getOriginBoardId());


I found this while searching for a solution. Also since I can not reproduce this on my local jira. How can I be sure this is my case?