Custom Issue ID Generation

We are in the process of migrating to JIRA. I am trying to find a way to use a custom field to tie JIRA to our legacy systems and processes.

Our scheme for issue IDs has historically been something like:

  • pppp-Tiiii
    • where: 
    • pppp is a four digit numeric project ID.
    • T is a letter indicating the issue type 
      • ('S' for software, 'D' for documentation, etc)
    • iiii is a four digit sequential issue number with leading zeros 
      • Each issue type has its own number series 
      • (i.e. S0001 and D0001 are different, unrelated issues)

I understand that JIRA will internally use its own key for each issue, but our team will need to continue using our legacy ID format.

When a new issue is created, I want to have the tool automatically generate the next number for the appropriate issue type.

I have found several plugins that can populate a string in a custom field, but they appear to operate on data that already exists in other fields.  Is there a way that I can have a counter for each issue type that will increment whenever a new issue of that type is created?

With this field, I believe I can concatenate data into a unique ID for each issue. 

Or, is there an easier way?

 

1 answer

You can the use post-function in the "Create" transition named "Update parameters of the Set Field Value to constant or Groovy expression Function for this transition." or "Scripted field" using the JIRA ScriptRunner. Your groovy code will have to concatenate and parse the current JIRA Project ID, Issue type and a code to get the project's issue counter in the database (very hard and nearly impossible)

Thank your for the response. I understand the basics of how this would be implemented (custom fields with post-function invoked scripts). I am trying to find some more information on what specifically the script would need to do. Can you point me to any documentation on JIRA's scripting API or database implementation? Are you saying that it is nearly impossible to access JIRA's internal issue counter? If it really is that difficult, I suppose we could add our own issue counter to the database. Again, I would need some documentation on the database implementation itself. Thanks again

I have not done anything like it so I can't suggest anything that gets information from a database (it's too tedious, you will need another tool to connect to the database that can work with your preferred language). If I really really need to implement this, at the top of my mind, I will use a shell script called in a post-function of the "Create" event. This shell script of mine will call the 'sqlplus' bin that I am using to connect to any database for any automation. Then update the existing ticket with the number.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,906 views 12 18
Join discussion

Atlassian User Groups

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!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot