Templates Usage Statistics API

Templates Usage Statistics API

Get Templates by Usage

Retrieve templates sorted by usage count in descending order, filtered to show only templates that have been used at least once.

Endpoint

GET

/rest/smartissuetemplates/1.0/template/by-usage

Parameters

Parameter

Type

Required

Default

Description

Parameter

Type

Required

Default

Description

limit

int

No

50

Maximum number of templates to return

offset

int

No

0

Starting position for pagination

Request Example

curl -X GET \ "https://your-jira-instance.com/rest/smartissuetemplates/1.0/template/by-usage?limit=20&offset=0" \ -H "Authorization: Basic <base64-credentials>" \ -H "Accept: application/json"

Response

Returns an array of templates sorted by usage count (highest first), containing only templates with usage count > 0.

[ { "id": 123, "name": "Bug Report Template", "description": "Standard template for bug reports", "usages": 156, "owner": { "userKey": "admin", "displayName": "Administrator" }, "projectId": 10001, "issueTypeId": "1", "createdDate": "2024-01-15T10:30:00.000Z", "updatedDate": "2024-01-16T14:20:00.000Z" }, { "id": 124, "name": "Feature Request Template", "description": "Template for new feature requests", "usages": 89, "owner": { "userKey": "product.manager", "displayName": "Product Manager" }, "projectId": 10001, "issueTypeId": "2", "createdDate": "2024-01-10T09:15:00.000Z", "updatedDate": "2024-01-10T09:15:00.000Z" } ]

Response Codes

Code

Description

Code

Description

200

Success - returns array of templates

401

Unauthorized - authentication required

403

Forbidden - insufficient permissions

500

Internal Server Error

Notes

  • Only returns templates with usages > 0 (filters out unused templates)

  • Results are automatically sorted by usage count in descending order

  • Uses current user context for permission filtering

  • Supports pagination for large result sets

Usage Examples

Get top 10 most used templates:

GET /rest/smartissuetemplates/1.0/template/by-usage?limit=

Get next page of results:

GET /rest/smartissuetemplates/1.0/template/by-usage?limit=20&offset=20

Get all used templates (large limit):

GET /rest/smartissuetemplates/1.0/template/by-usage?limit=1000

 

Templates - Low Usage Recently Updated

GET /rest/smartissuetemplates/1.0/template/low-usage-recently-updated GET /rest/smartissuetemplates/1.0/template/low-usage-recently-updated?minUsage=0&maxUsage=10&monthsAgo=6

Query Parameters:

  • minUsage - minimum usage count threshold (default: 0)

  • maxUsage - maximum usage count threshold (default: 10)

  • monthsAgo - how many months back to consider for "recently updated" (default: 6)

Bulk Deletion Endpoint

GET /rest/smartissuetemplates/1.0/template/delete/unused?excludeIds=300&excludeIds=301

This endpoint deletes all unused templates while allowing you to exclude specific template IDs that you want to preserve. (you can run it in your browser by user who have permissions)