Add sequence numbers to work items in Jira Cloud
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
Learn how to configure Jira Cloud to automatically assign work items a sequence number using Jira's automation rules and entity properties.
Solution
Setup an automation rule
Trigger: Issue created
Action: Set Entity Property
Entity type: Project
Property key: sequence
Property value:
{{#increment}}{{issue.project.properties.sequence}}{{/}}
Action: Edit item
IncidentID:
{{now.format("ddMMYYYY")}}-{{issue.project.properties.sequence}}
Test the rule by creating a new issue in the project to ensure the sequence number is appended correctly.
Additional steps
If you need to reset the sequence property when your project moves into production, follow these steps using the Jira Cloud REST API.
Pre-requisites
API Token: Obtain an API token for authentication. Follow this guide to create one.
Project ID or Key: Identify the project ID or key.
Steps to Set a Project Property
Determine the Request Endpoint:
Use the URL:
PUT https://<your-domain>.atlassian.net/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey}
Replace <your-domain>, projectIdOrKey, and propertyKey with your specific details.
Prepare Your Authentication:
Use Basic Authentication with your email and API token. Encode your email and API token in Base64:
Authorization: Basic base64(email:api_token)
Setup the Request Body:
Use JSON format for the property value:
{ "value": "example-value" }
Make the HTTP PUT Request:
Use a tool like Postman, cURL, or a programming language. Example using cURL:
curl --request PUT \ --url https://<your-domain>.atlassian.net/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} \ --user email@example.com:your_api_token \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "value": "example-value" }'
Verify the Response:
A successful request will return a 200 OK response with a JSON confirmation:
{ "key": "propertyKey", "value": "example-value" }
Handle Errors (If Any):
Common errors:
401 Unauthorized: Check authentication credentials.
403 Forbidden: Ensure you have the required permissions.
404 Not Found: Verify the projectIdOrKey and URL.
By following these steps, you can efficiently manage sequence numbers for Jira work items and reset properties when needed.
Was this helpful?