Invalid value '14930' passed for customfield 'Linked Fix Version List'. Allowed values are: , -1
I have created two custom fields the Second field values are displayed depending on the First custom field. Two fields are of type SelectList. while creating the issue I was getting the above error.
please help me out.
Thanks in advance
Perhaps you should have a look at cascade custom field.
Hi Vasiliy Zverev, could you please explain me how to create and use this cascade custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm getting the values of the second custom field programatically using behaviours and after that the create screen is giving the error.
my behavioural code is as follows:
import com.atlassian.jira.project.Project;
import com.atlassian.jira.project.version.Version;
def selver = getFieldByName("Linked Fix Version List");
def project = getFieldByName("Linked Project List").getValue() as Project;
Collection<Version> versions = new ArrayList<Version>()
if(project){
for(Version version :project.getVersions()){
if(version.isReleased()){
continue
}else{
versions.add(version)
}
}import com.atlassian.jira.project.Project;
import com.atlassian.jira.project.version.Version;
def selver = getFieldByName("Linked Fix Version List");
def project = getFieldByName("Linked Project List").getValue() as Project;
Collection<Version> versions = new ArrayList<Version>()
if(project){
for(Version version :project.getVersions()){
if(version.isReleased()){
continue
}else{
versions.add(version)
}
}
}
selver.setFieldOptions(versions)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Custom fields are create into admin section.
Here is discussed how ti se value for CascadeField: https://community.atlassian.com/t5/Jira-questions/Groovy-Set-Cascading-Field-Value/qaq-p/241484
What namely do you want to store into cascade field and why do you need versions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vasiliy,
I created a cascading custom field named projectList. I set the values for the parent options i.e project names and I need to get the options for the parent (versions) dynamically using behaviour code. Please help me to sort this issue.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's because your code is trying to do the wrong thing.
A cascading select list in Jira is a field similar to select list, albeit a bit more complicated because of the option-pairs, but the data and options are roughly the same principle.
The value you set in a selection is an option, one drawn from a list of pre-defined options read from the database.
Your behaviour is amending the presented list, adding options to it. It might appear to work on the front-end, but it's absolute nonsense to the field, because the values you are then trying to save do not exist as options for the field. It will only work if your administrators add all your project and version pairs to the field, in which case you can drop your behaviour script because the field is going to have them already.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
I am still facing the same issue. Let me explain you my issue in detail. I created a custom field project picker and one more customfield of type select list and now i am trying to get the versionList using the above behaviour code. Now the thing is I am able o get the versionList into the select list in front end but the selected version i not saved into db because of different option id's. can u please help me how to store those versions into db or any other alternative method to do this?
Thanks alot in advance,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The "selected id" is not being stored because your code is changing it to something that is wrong. I can't tell you what is wrong with your code because it seems to be doing something that is nonsense.
Could you describe exactly what you are trying to do?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yeah sure,
I will share some screen shots for better understanding.
1.Linked project list and linked fix version list are my custom fields. when I click on the create button I will be able to see the screenshot1.
2.In the next step if I select the project from LinkedProjectList then it will populate the corresponding versions of the selected project. This versions, are populated using behaviours script.
3.In screenshot behaviour u can see the code I used to get the versions to be popualated into Linked fixed version list.
4.After selecting the issue when I click on the create button then I am getting an error invalid value passed....
5.the Linked project List is of type project picker and Linked fixed version List is of type select list while creating this select list I added an option test version whereas all these things are shared in the screen shots
Please help me to sort this issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Again, your code is fetching an arbitrary version number which is not a valid entry for the field. That will not work, you cannot randomly add things to fields like that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can we have any api to insert the data into jira database. Is there any way to solve this or no use about thinking the solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can make separate REST calls to update Jira, including the ability to create versions (options in custom fields were not there last time I looked)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so very much for the help Nic, I think I can't solve this..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There isn't really anything to "solve" - your code is trying to use functionality that simply is not there.
At this point, it would be better to revisit the requirement and see what you might use to do it.
In your original question, you pretty much described the behaviour of a cascading select. Why are you not using one of them? What is the user going to get if you were to implement something else?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.