« Hooks & API

Tags

Last Updated: March 25, 2019

This API returns several latest tags for the issue.  Tags are sorted in chronological order from newest to oldest.

warning
To perform the Tags API call, the Jira user must have the permission to read the requested issue.
Tags REST API
url
/rest/gitplugin/1.0/issuegitdetails/issue/{issueKey}/tag
method
GET
parameters
issueKey        Path parameter.
Required.  Existing Jira issue key       Example: "TST-435"
tagsPerRepository
Required.  Value should be greater than or equal to 1.  This is the number of tags which should be returned for each repository associated with the issue.
Example:  /rest/gitplugin/1.0/issuegitdetails/issue/TST-435/tag?tagsPerRepository=2
result
Returns the number of tags according to the parameter value for each repository associated with the issue.

 

The result contains tag elements with basic information such as name of a tag, associated commit data, associated repository settings, etc.

The additional flag hasMore indicates if an issue contains more tags.  Increasing the quantity number for tagsPerRepository will return a large collection result depending on the size of the parameter value  –  in case hasMore has true as response.

 

Example:
http://jira.yourorg.com/rest/gitplugin/1.0/issuegitdetails/issue/TST-435/tag?tagsPerRepository=2

Result:
{
  "tags": [
    {
      "name": "v1.1",
      "commitId": "d802612a4969966820ffccd1d91ec40fa076e324",
      "repoId": 3,
      "repoName": "test-repo",
      "isGitViewerEnabled": true,
      "creationDateFormatted": "February 2, 2015 14:21:00 PM EST",
      "message": "Test release\n",
      "committerName": "developer",
      "committerEmail": "developer@example.com"
    },
    {
      "name": "v1.0",
      "commitId": "341511593086d572008f40e1cd19abf89fbff0ce",
      "repoId": 3,
      "repoName": "test-repo",
      "isGitViewerEnabled": true,
      "creationDateFormatted": "February 2, 2015 14:20:54 PM EST",
      "message": "Initial commit\n",
      "committerName": "developer",
      "committerEmail": "developer@example.com"
    },
    {
      "name": "v1.1",
      "commitId": "d802612a4969966820ffccd1d91ec40fa076e324",
      "repoId": 7,
      "repoName": "test-data",
      "isGitViewerEnabled": true,
      "creationDateFormatted": "February 2, 2015 14:21:00 PM EST",
      "message": "Test release\n",
      "committerName": "developer",
      "committerEmail": "developer@example.com"
    },
    {
      "name": "v1.0",
      "commitId": "341511593086d572008f40e1cd19abf89fbff0ce",
      "repoId": 7,
      "repoName": "test-data",
      "isGitViewerEnabled": true,
      "creationDateFormatted": "February 2, 2015 14:20:54 PM EST",
      "message": "Initial commit\n",
      "committerName": "developer",
      "committerEmail": "developer@example.com"
    }
  ],
  "isTagsFeatureEnabled": true,
  "hasMore": false
}

« Hooks & API