I have a field, "Name", that I'd like to set automatically when an issue is created. The values of this field will be in the form "Acme101623":
So, for the next issue, I'd need to see all other issues where this field is "Acme1016nn", then increment the highest "nn" value by one to find the next value. How can I do this?
You'll need to write code to do this. I'd keep it as simple as possible - a post-function that puts your data into a standard "read only custom field" (Those are intended to be populated by code). As usual, I'd do it with the Script Runner, but creating an add-on to contain the post-function would work fine too.
The Acme, month and year are quite easy to do. The sequential number is a bit more of a problem. You'll need to store that number somewhere, which isn't that hard (active objects if you're coding your own add-on. Script Runner, I'm less sure of), but you could run into "fun" with concurrency when two users are creating issues at much the same time.
Before you dive into piles of code though, could you explain the requirement from the users point of view though? There might be a better way to meet the need.
I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG