Hi Experts,
I am trying to create a custom field in Jira, that automatically generates a unique incremental identifier every time a new story is created. The required format for this identifier is YY‑MM‑XXXX, (YY - last two digits of the year, MM - month of creation, and XXXX - sequential number).
For example, the first story created in January 2027 should have the value 27‑01‑0001, the next one 27‑01‑0002, and so on.
When the month changes, the identifier should reflect the new month, but the incremental counter should continue increasing rather than resetting; for instance, if three stories are created in February, they would be: 27‑02‑0003, 27‑02‑0004, and 27‑02‑0005.
However, when a new year begins, the counter should reset, so the first story created on January 1, 2028 will be 28‑01‑0001 and continue following the above logic.
Hi @Maria Zahid
First why, as each work item in Jira has already a unique identifier and on creation created date is stored?
Second, calculation on number increments can only be done with number fields, these fields can only hold numbers no text characters.
You could use project properties see these articles for more info on project properties.
Thank you @Marc -Devoteam- for your input.
You are right that Jira provides a unique issue key but, in our case, we need an additional business-specific identifier to track customer RMAs. This identifier is not intended to replace the Jira issue key but to align with our internal process.
Regarding your second point, I agree that numeric incrementation is handled by number fields. In our case, the requirement is to generate a sequential numeric counter, but present it as part of a formatted identifier (YY‑MM‑XXXX) under a custom field. So, while the core logic is numeric, the final value is a structured combination of date and sequence.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Maria Zahid
Then see the options using project properties.
Or see other ways to identify an issue to a customer, is there a way via webhook or API to get this business specific identifier to add?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I used one of the solutions from this thread (https://community.atlassian.com/forums/Jira-questions/Auto-increment-a-custom-field-on-Jira-cloud/qaq-p/2280500) and I’m able to generate an incremental ID. However, I’m facing an issue with formatting.
Currently, the generated value is something like 26061, but I need it in an 8-digit format, for example 26060001.
To achieve this, I tried using the following expression in the Edit work item fields step:
but the sequence part is not being appended correctly, and I only get the date portion.
Could you please guide me on how to correctly format the incremental value to include zero-padding and ensure the sequence is properly appended? I have attached screenshots for reference.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried with the changes you suggested but now I'm only seeing year and month without incremental value.
{{now.format("yyMM")}}{{project.properties.sequence.leftPad(4,"0")}} - this is the updated expression I have used, while keeping the other setting as is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Maria Zahid
You can't combine function like this into a single value.
You probably can store the dat in the field using smart value options for concatenate
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/
So you probably will have to store the date value into a variable and concatenate the variable and the property.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.