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

Limit the Number of Components per Issue?

Problem: I would like to institute a rule for my teams, "One component per issue", and I do not see a setting, in the administrative section of JIRA, to implement this.

Relevance: Many of our reports look into the breakdown of any given project's work by component, having multiple components per issue can, ever so slightly, misrepresent those reports.

Comments: I know I can skirt around this problem by creating a custom field but, when you are in a JIRA project, it is nice to be able to click on the puzzle icon in the sidebar and view issues by component.

3 answers

1 accepted

3 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 13, 2017

If you were on Server, there's a hack you can apply to the field template which converts it to single-select.  (It remains a multiple entry field in every respect, but the users can't put more than one option into it)

Cloud does not support that.  Go with the custom field option (and maybe use components for something else)

Hey Nic,

I really appreciate the response!

That is interesting but alas, my team and I are on Cloud.

Have a great day!

Best,

Dan

@Nic Brough -Adaptavist- What is this amazing hack you speak of? We're on server and would love this.

Bonus points if you know how we can limit the components to a predefined list....

Thank you in advance!

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 17, 2019

You can limit the components to a list by having the project admins define the components correctly (non admins can't edit the list)

To limit it to one, find the .vm file that defines the field layout on edit and change it so it only allows for one selection, then restart Jira.  From memory, it's component-edit.vm somewhere below atlassian-jira/WEB-INF/classes/template/ - a quick search should find it (it definitely has component in the file name).  You may also want to edit the file for bulk change too.

Like # people like this

Hi Nic,

 

Thanks for blog. Could you please guide me what we need to change in Compontent-edit.vm?

 

Regards

Sarath

For folks who are on Cloud there is a validator called Field has single value that works to limit multi select fields on the workflow level.  It works beautifully for this.

I found a workaround for this on Jira Cloud.

I added two validators on one early transition in the workflow :

  • Multi-select field Components should not have more than one value (excluding values copied from sub-tasks)
  • If a value for field Components is not provided during the transition, show the following error: This field is required. 

I duplicated these validators to other key transitions in order not have an issue later on.

For my need, it seems to do the trick.

Does this require an Add-On?

David Eugene Callegari
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Oct 05, 2023 • edited

Hi Guillaume @Guillaume Wolf ,  I like this workaround.  Are those standard Validators or did you have to custom make them?  If standard, which validators did you use for preventing more than one value?

UPDATE:  Never mind.  I was able to do it with SR.  Thanks for the suggestion

Suggest an answer

Log in or Sign up to answer