Split verification of board

Verify the board setting on config page, there is some data redundancy. Besides, users will reset the verify status when modifying the date, resulting in a bad user experience.

  1. More simplified Verify API.
  2. New api to get info of datasource.

1. Split the origin board verify API

Section titled 1. Split the origin board verify API
  • AS-IS
paths: api/v1/boards/{boardType}
method: POST
request: {
  "type": "...",
  "boardId": "...",
  "projectKey": "...",
  "site": "...",
  "token(email+token)": "...",
  "startTime": "...",
  "endTime": "..."
}
responses:
  '200': {
    "users": [
        "..."
    ],
    "targetFields": [
        {
            "key": "...",
            "name": "...",
            "flag": false
        }
    ],
    "ignoredTargetFields": [
        {
            "key": "...",
            "name": "...",
            "flag": false
        }
    ],
    "jiraColumns": [
        {
            "key": "...",
            "value": {
                "name": "...",
                "statuses": [
                    "..."
                ]
            }
        }
    ]
}
  • TO-BE
paths: api/v1/boards/{boardType}/verify
method: POST
request: {
  "boardId": "...",
  "site": "...",
  "token(email+token)": "..."
}
responses: {
  "project": "ADM"
}
  • Exception Handler
statusmessagehintInfo
400Token cannot be empty.Please reconfirm the input
400Token’s pattern is incorrect.Please reconfirm the input
400boardType param is not correctPlease reconfirm the input
401Failed to get Jira info_status: 401 UNAUTHORIZED, reason: xxxToken is incorrect
403Failed to get Jira info_status: 403 FORBIDDEN, reason: xxx403 Forbidden
404Failed to get Jira info_status: 404 NOT_FOUND, reason: xxx404 site Not Found
404Failed to get Jira info_status: 404 NOT_FOUND, reason: xxx404 boardId Not Found
500Internal Server Error
  • Jira API

Get board

paths: https://%s.atlassian.net/rest/agile/1.0/board/{boardId}
method: GET
header: "Authorization: Bearer <YOUR-TOKEN>"

2. New api to get info of board

Section titled 2. New api to get info of board

Returns datas from a board, for a given board Id. Board configuration will use those datas, like Crew settings, Cycle time settings, Classification setting. The new api to get info of board will load when metrics page load board contents.

POST api/v1/boards/{boardType}/info
BodyTypeDescriptionNote
boardIdstringBoard ID.
projectKeystringSpecify the key of the project.
sitestringHost url of the board.
tokenstringAuthentication for board, it is included email and token input
startTimestringFillter results by startTime, it will use in JQL to get data.
endTimestringFillter results by endTime, it will use in JQL to get data.

Example

{
  "boardId": "2",
  "projectKey": "ADM",
  "site": "dorametrics",
  "token": "token",
  "startTime": 1700409600000,
  "endTime": 1701619199999
}
{
    "users": [
        "heartbeat user0",
        "heartbeat user1"
    ],
    "targetFields": [
        {
            "key": "issuetype",
            "name": "Issue Type",
            "flag": false
        }
    ],
    "ignoredTargetFields": [
        {
            "key": "summary",
            "name": "Summary",
            "flag": false
        }
    ],
    "jiraColumns": [
        {
            "key": "To Do",
            "value": {
                "name": "TODO",
                "statuses": [
                    "TODO"
                ]
            }
        },
        {
            "key": "In Progress",
            "value": {
                "name": "Doing",
                "statuses": [
                    "DOING"
                ]
            }
        }
    ]
}
  • Exception Handler
statusmessagehintInfo
400The startTime should be before the endTime.Please reconfirm the input
400Token cannot be empty.Please reconfirm the input
400Token’s pattern is incorrect.Please reconfirm the input
400boardType param is not correctPlease reconfirm the input
401Failed to get Jira info_status: 401 UNAUTHORIZED, reason: xxxToken is incorrect
403There is no enough permission.Permission deny
404Failed to get Jira info_status: 404 NOT_FOUND, reason: xxx404 Not Found
500Internal Server Error