I have problem setting a value for a custom field when creating a change ticket using jira API vi Ruby.
custom filed name and id is: customfield_14135:1
I am trying to set this custom filed like this:
"customfield_14135:1"=> {"id": "21277", "value": "IPG Big Data"},
the id and value is correct but it gives me the following error:
400 Bad Request: {"errorMessages":[],"errors":{"customfield_14135:1":"Field 'customfield_14135:1' cannot be set. It is not on the appropriate screen, or unknown."}}
Why do you have the :1 at the end of the custom field ID? You should try removing that. Custom field IDs never include things like that.
I did not configure that, the configuration of the ticket was done by Jira Admin which I am not. I just need to use that custom filed.
I was wondering if there is any way around it since i do not have the privilege to change the IDs?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me back up for a second. JIRA custom fields always follow a format of "customfield_xxxxx". So the one you're referencing is very odd and I'm guessing wrong. I would attempt again after remove the trailing ":1". It does not appear to be a valid cf id because of that last part.
I think your JIRA admin gave you an incorrect cf id.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I check the custom field IDs using browser inspect tools (page Elements), i can fill up all the other custom fields except the mentioned one. I think I need to contact Jira admin and tell them to modify the ID
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the reply that I got back from my Jira Admin
We cannot change the format for custom fields, it is an add-on by JIRA and we only have rights to add it to a screen.
Please let me know if there is any way for me to access this particular custom field with Ruby syntax?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your JIRA admin is correct. You need to reference the custom field ID "customfield_14135" and not what "customfield_14135:1".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The :1 is not part of a custom field ID, it's wrong. Remove it and try again with a valid id.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The following are two of the custom fields residing in one page
<select class="select cascadingselect-child" id="customfield_14135:1" name="customfield_14135:1">
<select class="select cascadingselect-parent" id="customfield_14135" name="customfield_14135">
I need to access both if these custom fields.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Those are html element ids, and useless to you in terms of remote API code.
You need to use the custom field id as Kyle says.
For cascading selects, you need to set the top level and then use child for the second half:
{"value": "Top level value", child: {"value":"IPG Big Data"}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's a single custom field. Here's a groovy example of how it's done. In null, you will set parent. In 1, you will set child.
REST example
"customfield_10001": {"value": "green", "child": {"value":"blue"} }
Java/Groovy example
{{null: parent} {1: child}}
I don't know what exactly this Ruby is expecting so use these above as examples. Also, this sort of CF is known as a Cascading Select -- it is different than other selects in JIRA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi. If this answer helped, please use the checkmark to accept the answer. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
how can i get the custom fields_id and my code was to add custom field from jira api
and my doubts are in this value number how to set ??
and i want to create cascading select while adding custom field
and in this value and child value how i want to set please any one help me.
"customfield_10001": {"value": "green", "child": {"value":"blue"} }
is this the way to do or i am going in wrong direction.
def create_custom_field(self):
a = {
"fieldName": "Story Points",
"fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect",
"value": "12"
}
b = self.jira.custom_field_option(fields = a)
return b
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.