pythonjira

Jira Python Custom Fields


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"
                            )

Solution

  • 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.