- Get started
- About
- Quick guide
- Use cases
- Glossary
- Migration
- Configuration
- Global configuration
- Project configuration
- Repository
- Template configuration
- Template scope
- Manage templates
- Supported fields
- Permissions
- Using templates
- Create issue from template
- Create issue structures
- Apply, clone, recreate
- Use template custom field on issue create screen
- Default templates
- Direct link
- JQL searchers
- Variables
- Static variables
- Dynamic variables
- App Integrations
- Team-managed projects
- Jira Software
- Jira Service Management
- Advanced Roadmaps
- Issue Checklist for Jira
- Advanced
- Automation
- Legacy automation action
- REST API
- Create issue and apply template with Jira REST API
- Security
- Security statement
- App permissions
Apply template with REST API
With Issue Templates for Jira you’re not limited to using a template with Jira only. You can also use external software to trigger different events in Jira and apply a template immediately.
With this feature you can:
- Connect this function with Zapier, Jenkins, or Bitbucket for example, to automatically create an issue and apply a template with data from a received e-mail.
- Use templates from Jira Automation and apply them to an issue in any moment on any action in automation.
- Synchronize it with Requirements and Test Management for Jira , so when a user creates an issue with a specific status a selected template can be applied and values filled.
To use Apply template with REST API enable the Apply template option in global configuration - Visibility.
Automatic tests with Jenkins are launched, but they fail. Jenkins creates a job and then a Jira issue using REST API. It applies a template afterwards, which fills necessary information and creates a structure, used by a developer and tester to fix the error.
Configuration - Generate a token
To connect Issue Templates with external software to use API, you need to generate a token.
-
Go to Api Tokens tab in the configuration of Issue Templates (Apps>Issue Templates>Configuration>API Tokens).
-
Click Generate token.
-
Type in a label, that will be used to identify tokens, and select a specific user selected from the list.
-
A token will be generated for this user.
You can see and copy the token only when you create it. It can’t be accessed later on.
Configuration - REST API
Follow these steps to configure REST API (with Postman as an example).
-
Use an API platform.
-
Paste the API URL:
- EU data residency -
https://itc-eu.deviniti.com/public/api/apply-template
- US and Global data residency -
https://itc-us.deviniti.com/public/api/apply-template
- EU data residency -
-
Place the token in the Authorization header as a bearer.
-
Add
application/json
value to the Content-Type header. -
Add the following code to the body:
{
"issueId": "27831",
"templateId": "TM-1"
}
-
issueId is the ID of an issue that you want the template to be applied to
-
templateId is the issue key of a template you want to use.
You can use both issuekey and issueId parameters.
Go to Atlassian documentation to find out how to check an issue ID.
- Click send.
Configuration - REST API in Jira Automation
This example shows how to use REST API in Jira Automation.
You can use the Send web request trigger instead of issue property to apply a template with this feature.
To configure this rule you need to:
- Paste the app URL
${baseURL}/public/api/apply-template
. - Paste the previously generated authentication token.
- Paste the body with the template and current issue filled (you can use smart value to get the current issue).
Result
Status | Meaning |
---|---|
202 | Accepted |
400 | Bad request - wrong payload (body) |
401 | There is no token |
403 | Incorrect token/invalid license |