Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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?


2 answers

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.

0 votes
LP I'm New Here Mar 24, 2021

@Ben Damonte Did you ever work this out? I am trying to achieve the same thing by generating a custom plugin. I would like to avoid using scriptrunner

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you