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

customefield type Label : Length of each entered input into the field should be 8

Hello Community


I am stuck with a scenario. Please help me. I have a custom field type : Label in my issuetype Epic. Name of Label (customefield is) :  Additional IDs.


User is expected to enter minimum 1 and maximum 10 Ids into the field and each entered Id must be 8 Characters long only. If user enters more than 10 Ids, an error should be shown on the screen. If user enter an Id which is not equal to 8 characters should throw an error on the screen as user updates epic.  

I have Scriptrunner installed on my jira server edition. 

Please advice me how to implement this constraints on the field. 

Thank you .


1 answer

0 votes

You can add a Validator of type Simple scripted validator [ScriptRunner] with a Condition like this:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.fields.CustomField
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField myCustomField = customFieldManager.getCustomFieldObjectsByName("Your Custom Field Name")[0]
boolean allValidLength = true
int numLabels = 0
if(it.toString().size() != 8){
allValidLength = false
return numLabels <= 10 && allValidLength

And an Error Message like: Each Additional ID must be 8 characters in length, and there must not be more than 10 of them.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

172 views 6 7
Read article

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