I've been using Jira-Python REST API version 0.1.dev50 to create an app that will update custom fields in a Jira issue (Snippets below exclude Jira client set-up scaffolding for brevity).
I need to update a custom field of "select list" type in relation to the user's option. The options are the same as in the Jira's list.
Updating multiple line text is possible without any problem.
However, I can't update the "select list" type, receiving the following:
JiraError HTTP 400 url: https://your.place.net/rest/api/2/issue/26416
text: Could not find valid 'id' or 'value' in the Parent Option object.
The following code works well if I am using a custom field of text (multiline) type:
customfield = textbox.objectName()
customtext = textbox.currentText()
self.Jissue.update()
self.Jissue.update(fields = {customfield: customtext})
The textbox.objectName() will retrieve the custom field id.
From what I got from the Jira-Python's documentation, the problem is how to set up the issue.update part. However, I can't find the right way to update this "select list" type of custom field.
Comments on this, or suggestions, will be greatly appreciated.
Hi @Rodrigo Bammann ,
Here's some examples in the JIRA REST API: Setting custom field data for other field types
Also, recently .... none of these worked for me and i simply had to use:
'customfield_14215': [test]
I got to this by looking at the JSON representation of an issue that had a value for the field i was looking to update
<jira-url>/rest/api/3/issue/{issueIdOrKey}
Based on the JIRA REST API that you provided, @Edwin Kyalangalilwa , I was able to change it and it worked.
The following modification is what made it work:
self.Jissue.update()
self.Jissue.update(fields = {customfield: {"value": customtext}})
Thanks for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad to hear it's working!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline 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.