I'm just trying to write a simple script to update a JIRA via the REST API. The field I want to update is a custom cascading select field.
I'm working from this tutorial:
https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Edit+issues
Here is the command I'm executing:
curl --insecure -D- -u <username>:<password> -X PUT --data @input.dat -H "Content-Type: application/json" "https://<ourURL>/rest/api/2/issue/IPCLIENTS-12043"
and here is the content of input.dat:
{ "update" : { "customfield_11272" : [{"set" : {"value" : "External Customer (Worst)"}}], "customfield_11272:1" : [{"set" : {"value" : "Production"}}] } }
where customfield_11272 is the name of the parent, and customfield_11272:1 is the name of the child in the cascading select field
I keep getting the message:
{"errorMessages":[],"errors":{"customfield_11272_1":"Field 'customfield_11272_1' cannot be set. It is not on the appropriate screen, or unknown."}}
I also tried using the "fields" function instead of "update", but got the same error, as did using customfield_11272_1
So, obviously, I am not going about this properly. If I delete the second line, it updates the top level fine. What is the proper syntax for updating the second level of the field?
Community moderators have prevented the ability to post new answers.
Nevermind... it was documented, more or less, in the Create Issue part of the tutorial:
{ "update" : { "customfield_11272" : [{"set" : {"value" : "External Customer (Worst)","child": {"value":"Production"}}}] } }
The code is as above. That is the content of the input.dat file for use with the curl command in my original post. It updates cascading select field "customfield_11272"
with top level "External Customer (Worst)" and second level "Production". Alternately, you could put all of it on one line, surround it with single quotes, and put it after --data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The code is as above. That is the content of the input.dat file for use with the curl command in my original post. It updates cascading select field "customfield_11272"
with top level "External Customer (Worst)" and second level "Production". Alternately, you could put all of it on one line, surround it with single quotes, and put it after --data
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you!
I would also add that almost the same pattern works with issue transitions if there are cascadingselect fields that need to be filled to do a transition.
With but one small change:
"customfield_11272" : {"value" : "External Customer (Worst)","child": {"value":"Production"}}
instead of
"customfield_11272" : [{"set" : {"value" : "External Customer (Worst)","child": {"value":"Production"}}}]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, This has worked for me; I am using python jira rest module;
from jira import JIRA
import re
options = {
'server': 'https://jirahost.com/jira/',
'verify': False }
jira = JIRA(options, basic_auth=('userid', 'password'))
issue = jira.issue('PROJ-1')
issue.update(fields={'summary' : 'Re-assigned to John Doe' \
,'assignee': {'name':'johnd'} \
, "customfield_14510":{"value" : "Dec-18", "child": {"value":"25%"}} \
, "customfield_14511":{"value" : "Jan-19", "child": {"value":"75%"}} \
})
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.