Forums

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

Unable to update Custom Field - getting 400 exception

Rajesh M January 8, 2021

Hi I am getting below exception when trying to update a custom field ( "Customer Request Type" - [cf12500])  after create JIRA ticket. 

 

<class 'jira.exceptions.JIRAError'>
(400, "Field 'status' cannot be set. It is not on the appropriate screen, or unknown., Field 'customfield_12500' cannot be set. It is not on the appropriate screen, or unknown.",

below is the python code: 

def createJIRASession(user,passwd):

      jira=JIRA(server="https://myJIRAServer.com/issues/",basic_auth=(user,passwd))

     return jira
def updateJIRATicket(jira,tkt_number):

try:
'''issues = jira.search_issues(f'key = "{tkt_number}"')
'''

flds = {
'components' : [{'name' : 'FCS'}],
'labels' : [{'name' : 'FCS Monitoring'}],
"priority" : "Major",
"status" : "Ready",
"customfield_10702" : "GRS",
"customfield_12500" : [{"name":"Troubleshooting"}]
}
#fields['components'] = [{'name' : 'FCS'}]
issue = jira.issue(tkt_number)
issue.update(fields=flds)
except Exception as inst:
print("Exception")
print(type(inst)) # the exception instance
print(inst.args) # arguments stored in .args
print(inst)

finally:
return issue

 

2 answers

1 vote
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
January 8, 2021

Hi @Rajesh M welcome on the community.

You cannot set Status (if it is Jira Issue native Status - Todo, In Progress..) directly but you have to use transition to move issue to the status. Give a change to REST API endpoint: https://docs.atlassian.com/software/jira/docs/api/REST/8.13.2/#api/2/issue-doTransition

Rajesh M January 8, 2021

Hi @Martin Bayer _MoroSystems_ s_r_o__ 

Thanks for your quick response and reference link.

Can you please advise on customfield_12500 ("Customer Request Type" / "Request Type"), which I am unable to set too.

Like Rajesh M likes this
0 votes
Mohamed Benziane
Community Champion
January 8, 2021

Hello @Rajesh M 

 

Can you make sure that using the UI you have this field on the screen and you can update it?

 

Hope this helps

Rajesh M January 9, 2021

@Mohamed Benziane  I have that field in the UI screen, I am able to change that field, but not through python program. 

issues/browse/{TicketID}

 

image.png

Rajesh M January 9, 2021
<customfield id="customfield_12500" key="com.atlassian.servicedesk:vp-origin"><customfieldname>Customer Request Type</customfieldname><customfieldvalues><customfieldvalue data-key="lsos/da5686dd-6535-4174-8d8f-b068c38a7cb8"><![CDATA[ Other ]]></customfieldvalue></customfieldvalues></customfield>

Suggest an answer

Log in or Sign up to answer