Hi All,
In my Jira instance, I have one number custom field. the thing is it has to generate the set of number automatically when the ticket is created, like Jira issue ticket number
Thanks in advance
Hello @Pooja
You can use logic in post-funciton of create transition to fetch the issue Key and add a random number logic and create a new number for the custom field.
There are plenty of examples of generating random numbers available in java/groovy.
Yes, you can do this, but you are going to run into two problems:
1. It is possible for two issues to get the same number if they are created at a similar times
2. It's going to be useless. There are no advantages to sticking yet another identifier on a Jira issue when the issue key has more use and is what your users will use.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the suggestion.
I am okay with the problems. Can you suggest me how to create a field using script runner?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would create the field manually, adding a simple numeric field to all issues. Do not place it on any edit or create screens.
You will then need to create a post-function or listener with a script (a listener is probably easier, as you won't need to add it to every workflow like you would with a post-function).
The listener should listen for create issue events, run a search for "new field is not empty", get the highest number from that and add to it before populating the field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Adding a simple numeric field to all issues- could you still more elaborate on this part.
2. You will then need to create a post-function or listener with a script- In my case, I just want this feature for the single project so I thought of using post function and suggest me with the script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure how to elaborate on "add a new field" - log in as an admin, and add a field, like all the other custom fields.
I don't have time to write scripts for other people, especially not ones that don't have any use and can go wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.