Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner post function: Search for highest number in custom fields and set the next higher numbe

Shinde_ Mukund
Contributor
March 3, 2022

Jira Cloud Script: I got a custom field (text) named "KB Number" readonly field. The field should be filled on a certain workflow transition (post function). I need to get the highest previously used number so far in other issues of the same JIRA project and increase the KB number of the current issue by 1.

Background: The idea is to generate some sort of sequential KB number based on different versions or customfield value .

Example: Version 1 - Script generates New KB Number starts with 1 (eg: 12345)

For version 2 - Script generates New KB Number starts with 2 (eg: 22355)

1 answer

1 accepted

0 votes
Answer accepted
Shinde_ Mukund
Contributor
September 14, 2023

Thanks for checking out my community post. I have figured out the Groovy Script for my required. Please let me know If any once else requires assistance on the same matter.

Suggest an answer

Log in or Sign up to answer