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
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rajesh M it is described in this KB article nicely:
Is it enough for you?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<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>
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.