Forums

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

Limit list of values depending on the transition

AgileHappyLearner
Contributor
February 8, 2024

I have a custom field with a list of 7 posible values and two options for transition to done category (Closed or Obsolete), I would like to limit the dropdown list to the first two values when the issue transition to closed and the other values in the list when transition to Obsolete. Could you help me with this?

2 answers

1 vote
Craig Nodwell
Community Champion
February 8, 2024

Hi @AgileHappyLearner do you have any plugins available to you?  This would be something that scriptrunner could easily handle for you.

AgileHappyLearner
Contributor
February 15, 2024

Hello @Craig Nodwell , thanks for your answer, I have Scriptrunner but I haven't seen any option for displaying some options when transition to one status A and other options when transition to status B

Craig Nodwell
Community Champion
February 15, 2024

Option for displaying options?  Scriptrunner is a scripting tool there's no options to set you need to script this out.  There's plenty of examples in the Adaptavist Library.

0 votes
Hariharan Iyer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 8, 2024

Hi @AgileHappyLearner ,

You can't restrict the items that are show in the dropdown, but you can disallow the transition if the value of the field is an invalid one with a workflow rule.

Go to Project Settings -> Issue Types -> Edit Workflow and select "Rule" from the top. Here select "Restrict to when a field is a specific value" and fill in the particulars for your transition and custom field.

Since you want to allow multiple values for the custom field, you will have to add more rules and "Group" them as well. Here is the process to do that:

1. Click the lightning icon on your transition - the rule should show up on the right.

2. Click on the 3-dots menu next to "MUST BE ALL" and select "Add rule to group"

3. Again select "Restrict to when a field is a specific value" and repeat the steps for all allowed values for a transition.

4. Finally, click on "MUST BE ALL" and change it to "CAN BE ANY".

 

Repeat for your second transition as well.

 

Hope that helps!

AgileHappyLearner
Contributor
February 12, 2024

Hello @Hariharan Iyer 

Thanks for your response, I don't want to apply this only for a project, I would like to have this configuration for all the projects using this workflow, but in any case, I followed your steps and select one of the projects that is using this issue type with this workflow but when I select the "Edit" workflow I don't have any "Rule" option to select

Hariharan Iyer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 12, 2024

I would like to have this configuration for all the projects using this workflow,

 

That's not a problem - as long as you have permissions, you should be able to edit a workflow that's used by multiple projects as well. 

 

when I select the "Edit" workflow I don't have any "Rule" option to select

 

That may be because you're viewing the workflow in the old editor. To switch to the new one, you can click on "Switch Editor" on the right.

On the old editor, I think you'll have to click on a specific transition, and then either add one or more conditions or validators. I'm not very familiar with the old editor though :-(

 

AgileHappyLearner
Contributor
February 15, 2024

Hello, should be for the Jira version I have but I can't see this option of "switch editor", I'm working with Data Center 9.4 version

Like Craig Nodwell likes this

Suggest an answer

Log in or Sign up to answer