Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Suppose we want to display total number of issues in active sprint versus number of issues completed in the sprint. By examining JIRA Jira Software REST API, we find "Get issues for board" GET /rest/agile/1.0/board/{boardId}/issue: Returns all issues from a board, for a given board Id.

So, it returns all issues for the board and we want only issues that belong to an active sprint. Luckily the method has "jql" parameter, by passing which, we can apply additional JQL filtering. JQL function is to get issues belonging to active sprints: sprint in openSprints () and additionally to get issues that are completed: status in (Done). Please make sure to put here status or comma separated statuses that are appropriate for your workflow and match "completed" columns of the board. The board id can be extracted from the URL shown in your browser address bar when you select the board: https://brizoit.atlassian.net/secure/RapidBoard.jspa?rapidView=6.

So, finally we have 2 calls:

  • To retrieve all issues from the active sprint: /rest/agile/1.0/board/6/issue?jql=sprint%20in%20openSprints()&fields=id
  • To retrieve completed issues: /rest/agile/1.0/board/6/issue?jql=sprint%20in%20openSprints()%20and%20status%20in(Done)&fields=id

...

When searching how to retrieve JIRA data that you want to display in your gadget, you should start from checking public REST APIs.

  • JIRA REST Jira REST API: Cloud and Server
  • JJIRA Service Jira Service Desk REST API: Cloud and Server
  • JIRA Software Jira Software REST API: Cloud and Server