Hi team,
i'm having an issue with a very specific requirements.
Im working in a very sensitive environment where information is shared on strict need to know basis only.
The setup we've built is based on SSOT where initiative is considered as a master project that with some automations creates epics in dedicated team spaces for teams and passes a specific information that we are comfortable to share from the master project (initiative)
now the issue lies within a specific requirement where 1 epic needs to be created with a specific parameter where it iterates the name.
As an example.
User creates an initiative and at specific point it will create an epic in a dedicated space. That epics name MUST be G00001
IF a user creates another initiative and that initiative creates Epic it HAS To be named G00002 (+1 from the previous name) so each epic that is created within that space gets automatically named as an iteration of previous name.
This is done for a security reasions and i'm trying to figure out how to make it happen as it seems that i need to find a way to store the last named summary as a global variable.
we have scriptrunner if that helps, but i'm still struggling to find a way how to make it happen
Hi,
Jira does not provide a native “global counter” or auto-incrementing name feature across issues, so this can’t be achieved with standard automation alone. You need a way to persist and increment the last used value.
Since you have ScriptRunner, a common approach is:
* Store the last generated number in a central location (e.g., ScriptRunner database table, file, or a dedicated “counter” issue/property)
* On epic creation, read the current value
* Increment it (+1)
* Format it (e.g., G00001 → G00002)
* Set the Epic Summary accordingly
* Save the new value back to storage
Important considerations:
* Ensure the script runs atomically to avoid duplicates if multiple epics are created at the same time
* Restrict permissions on the storage location (fits your security requirement)
* Trigger the script during the epic creation automation
Without ScriptRunner, the only workaround would be manual naming or an external service. With ScriptRunner, this pattern is fully achievable.
Hope this helps 👍
As others suggested, you could store that "sequence" (the last number you used) in a project property.
But, as you can manage properties through the Jira REST API, and there is the general "Send web request" automation action, you could implemented this logic using standard automation rules. It is an alternative you could consider.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Artus,
The way to do this with ScriptRunner for Jira Cloud is to use the Project Properties API's to save the latest epic name into a project property for the script to read and use.
There is no access to the file system inside Jira Cloud so using Project Properties would be the best way to persist this data.
Using these, you would then be able to create some logic in a script, such as a Script Listener, which, when an Epic was created, pulled the last Epic Name from the project property and set the new Epic Name to this value, incremented by 1.
Finally, you would update the project property to save the new value so that it is updated for the next time a new Epic is created.
I have an example script which shows how to get and set project properties here, and you can run this on the Script console to see how this works for reference.
I hope this helps.
Regards,
Kristian
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.