3

I am writing a script to create bugs. We have many custom fields and I cannot figure out how to get them to work correctly in the python code. Can someone please help explain? I have read through as many articles as I can find but none of the solutions are working.

One example of my custom field names is customfield_15400 and has a default value of "NO". The error I get with my below code is:

response text = {"errorMessages":[],"errors":{"customfield_15400":"Could not find valid 'id' or 'value' in the Parent Option object."}}

Code:

    project_dict = {'Aroid':'SA', 'OS':'SC'}
    epic_dict = {'Aroid':'SA-108', 'OS':'SC-3333'}

    for index, row in bugs.iterrows():
        issue = st_jira.create_issue(project= project_dict[row['OS']], \
                            summary= "[UO] QA Issue with '%s' on '%s'" % (row['Event Action'], row['Screen Name']), \
                            issuetype= {'name':'Bug'},\
                            customfield_15400="No"
                            )

4 Answers 4

5

Try the following :

customfield_15400={ 'value' : 'NO' }

You can also do the following, value_id being the id of the value in your Select Field :

customfield_15400={ 'id' : 'value_id' }

Indeed the value of a SelectField is an object, described by its value and its ID.

Sign up to request clarification or add additional context in comments.

Comments

3

Incase anyone else needs the solution. Below works.

project_dict = {'Android':'SA', 'iOS':'SIC'}
epic_dict = {'Android':'SA-18', 'iOS':'SIC-19'}

for index, row in bugs.iterrows():
issue = st_jira.create_issue(
                            summary= "[UO] QA Issue with '%s' on '%s'" % (row['Event Action'], row['Screen Name']),\
                            labels = ['UO'],\
                            assignee={"name":""},\
                            versions=[{"name":"4.4"}],\
                            fields={'project' : project_dict[row['OS']], \
                                    'summary': "[UO] QA Issue with '%s' on '%s'" % (row['Event Action'], row['Screen Name']),\
                                    'labels': ['UO'],\
                                    'assignee':{"name":""},\
                                    'versions':[{"name":"4.4"}],\
                                    'issuetype': {'name':'Bug'},\
                                    'customfield_15400': {'value':'Yes'}} 

                            )

Comments

2
issue.update(fields={'customfield_10100': {'value','Two'}})

above will throw the error saying data was not an array

"response text = {"errorMessages":[],"errors":{"Custom_field":"data was not an array"}}"

=> you could try like this -:

issue.update(fields={'customfield_10100': [{'value': "Two"}]})

1 Comment

You are doing a good job answering questions. improve your answer by following these guidelines. stackoverflow.com/help/how-to-answer
0
issue.update(fields={'customfield_10100': {'value','Two'}})

I have a multiselect list and below error occurs if i try to update

"response text = {"errorMessages":[],"errors":{"Custom_field":"data was not an array"}}"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.