Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Custom Field with Auto Generated Value

Hi Community.

Right now I'm using Service Management free plan. I would like to create a custom field with an auto generated value for my issues. The value I want is a series of number combined with the date and the number of issue key. 

I want to value would be YYMMXXXX (Y=year, M=month, XXXX=number part of the issue key). For example, today is Oct 2023 and the issue key of the newly created issue will be ABC-5, then the value in the field will be 23100005.

Is it possible to be created? (even with JQL or other programming method)

Thank you.

1 answer

1 accepted

2 votes
Answer accepted
Tim Kopperud
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 12, 2023 • edited

Hi @Dearka Chan 

You can du this with Automation and apply this to your custom field

{{now.format("yyMMdd")}}{{issue.key.split("-").last}}

Here is an example of such rule. Notice I used the Summary field, but you shuld change that to your customfield. 

split.png

The result will be like this:

splitRes.png

Edit:

I now see that you don't want the day. Simply remove "dd", so it is like this:

{{now.format("yyMM")}}{{issue.key.split("-").last}}

Notice MM must be capitalized.

 

TimK

Thank you, it really helps a lot. By the way, if I want to recalculate the issue number in the start of every month, can the last part of the value changed from the number part of issue key to the issue number of this month? 

For example, the next issue is the 6th issue in this month, can the value be 23100006?

Like Tim Kopperud likes this
Tim Kopperud
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 12, 2023

Hi @Dearka Chan 

I see. Change the rule as shown below.

lookupSummary.png

You will need to find all issues created in this month and then use lookupIssues which will contain those issues. Then you can use the smart value function size to fetch this "counting number". Adjust the smart value formula to this: 

{{now.format("yyMM")}}{{lookupIssues.size}}

TimK.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events