Forums

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

Update Custom Field having drop down using python

Himanshu_Pant April 29, 2019 edited

Hi Team,

 

I have a custom field named as Error Category (customfield_15526). It is a drop down box to select any error category from JIRA Web service.

 

I have written a script to update error category but getting error below.

Code

issue=jira.issue('TEST-156687')

category=['Timeout']
issue.update(fields={'customfield_15526': {'value': category[0]}})

 

Error

jira.exceptions.JIRAError: JiraError HTTP 400 url: https://xyz/rest/api/2/issue/4799869
text: data was not an array

response headers = {'X-AUSERNAME': 'username', 'X-AREQUESTID': '203x49518050x3', 'X-XSS-Protection': '1; mode=block', 'Content-Security-Policy': "frame-ancestors 'self'", 'X-Content-Type-Options': 'nosniff', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'X-Seraph-LoginReason': 'OK', 'Vary': 'User-Agent', 'X-ASESSIONID': '15t845a', 'Server': 'Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips', 'Connection': 'close', 'Cache-Control': 'no-cache, no-store, no-transform', 'Date': 'Mon, 29 Apr 2019 10:23:04 GMT', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Type': 'application/json;charset=UTF-8', 'X-ASEN': 'SEN-312257'}
response text = {"errorMessages":[],"errors":{"Error Category":"data was not an array"}}

 

 

Please suggest if I am dealing wrong data type to update the column using python

jira error category.JPG

2 answers

0 votes
Gonchik Tsymzhitov
Community Champion
May 22, 2019

What was the error?

Himanshu_Pant May 27, 2019 edited

:{"Error Category":"data was not an array"}}

 

Could you please suggest how can I resolve this issue ?

 

Gonchik Tsymzhitov
Community Champion
May 27, 2019

Is this single select type or multi select type?

And could you get the values from issue? what is the type? 

Himanshu_Pant May 28, 2019

It is multi select type using ctrl or shift button.

CODE:-

issues_in_project = jira.search_issues('project = TEST AND issuetype = "Job Failure" AND status = Open AND assignee in (EMPTY,support) order by updated DESC',maxResults=100)

print issues_in_project

Result :

[<JIRA Issue: key=u'TEST-411366', id=u'6056712'>]

 

How can I get to know about type of custom_field ? 

0 votes
Himanshu_Pant May 13, 2019

@Shaun Seaver @Warren Levy Please have a look once.

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events