You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I want to have a custom field that should generate number sequence starting from given value and iterate over next issue creation.
E.g Starting Value=4000
My first ticket in Project should have value 4001, TEST-2 as 4002, TEST-3 as 4003 and so on.
I tried to create using Scripted field in Scriptrunner but it is not working. Value are not stored in Scripted field, So i cant take value and add+1 for next ticket.
Could you help in generating sequence of numbers iterating over tickets using scriptrunner Behaviour or Scripted Field
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
def cctype = customFieldManager.getCustomFieldObject('customfield_1500')
def startID = customFieldManager.getCustomFieldObject('customfield_1503')
def ccnid = customFieldManager.getCustomFieldObject('customfield_12501')
//String stringToConvert = String.valueOf(ccnid_value);
//Long convertedLong = Long.parseLong(stringToConvert);
// return (convertedLong+1l).toString();
I have one jira version ...i want increase version number only how it's possible do you have any idea about on this.
my version is like : 2022.11.0 - project v33.0.0
i want to increment in this manner : 2022.12.0 - project v33.1.0
2023.01.0 - project v33.2.0
Could you please help me out on this.
You can us the ID of the ticket to increment the counter but you'll need to set this value on every ticket to do like this.
Since scripted field are not fixed (they're calculated when issue load) you can't even try to get the previous value and increment it.
I'm afraid they're no real solution to do this without having the field on every issue.
Ticket number are stored in Database. You can't use the same logic since the scripted filed is calculated so let imagine what you can do and why it's not possible to think this way :
You can set a hard value on DB (lets say 4000)
Every time you want to set the field on an issue you take the value and then you increment the value on the database ( for the future use ) ( so you say to you issue you value is the one in the database  and increase the value of the one in the database by one )
If you look to your issue you will see that the value is 4001, because everytime you look at the issue the field is calculated. No value are stored.
So you can't use Scripted field for sure.
On the other side customfield store value, so maybe doing a script based on a customfield can do the trick.