Jira URL REST Problem

So our Jira Project URL is: https://(jiraproject).atlassian.net/jira/software/projects/(projectname)/boards/1
We have to access the REST API from it but unfortunaly i can’t find a proper access for this url, because the documentary says i should contact http://host:port/context/rest/api-name/api-version/resource-name
My question is, how i can access the Rest API of my Jira board?

@Alexanderkuttner welcome to the Atlassian developer community.

The short answer is a real REST URL for your board will look like this:
https://devpartisan.atlassian.net/rest/agile/1.0/board/1

To explain, we can work backward from the URL template provided on the specific documentation for getting a board with GET /rest/agile/1.0/board/{boardId}. We need 2 things for this. The base URL and the boardId. The pattern for appending the base URL is shown in the curl example as:
https://your-domain.atlassian.net/rest/agile/1.0/board/{boardId}

No port or context to worry about. That’s just legacy documentation from when the same code was used for on-premise Jira Server.

Next, we can do human URL parsing to find that your boardId is 1. Or, we can use the get all boards endpoint (I have no idea why this endpoint is not listed with other board operations) with GET /rest/agile/1.0/board and the right query parameters. For example, we could add ?projectKeyOrId=TIS to get boards for a project (though uncommon, there can be multiple or none).

If I don’t pass any expand parameters, the result looks like this:

{
  "maxResults": 50,
  "startAt": 0,
  "total": 1,
  "isLast": true,
  "values": [
    {
      "id": 7,
      "self": "https://devpartisan.atlassian.net/rest/agile/1.0/board/7",
      "name": "NGEW board",
      "type": "simple",
      "location": {
        "projectId": 10703,
        "displayName": "Next-gen Enterprise Workflow (NGEW)",
        "projectName": "Next-gen Enterprise Workflow",
        "projectKey": "NGEW",
        "projectTypeKey": "software",
        "avatarURI": "/secure/projectavatar?size=small&s=small&pid=10703&avatarId=10808",
        "name": "Next-gen Enterprise Workflow (NGEW)"
      }
    }
  ]
}
1 Like

Thank you for your reply, it works!
But i have one question left: When i search something with jql, my url is https://(project).atlassian.net/browse/(jql)

How can i connect the Rest API data for this?
Thank you for your patience!

@Alexanderkuttner,

I’m confused. If you want to search for issues, use the JQL end point. But the URL you are showing isn’t for JQL, it’s just to show a specific issue. For that, get issue with GET /rest/api/3/issue/{issueIdOrKey}.

I have already fixed it!
Thank you for your help!

1 Like