Hi.
I'm trying to create a new jira story using a dictionary in python. Everything works except the setting of the Fix Version/s field. Here is the code:
------------
def create_gen_jira_story(jira_project,summary,description,issuetype,assignee,labels,fixby,fixversion):
# Creates a general jira story with a pre-defined set of values. Uses a dictionary to build the story
issue_dict = {
'project': {'key': str(jira_project)},
'summary': summary,
'description': description,
'issuetype': {'name': issuetype},
'assignee': {'name': assignee},
'labels': [labels],
'customfield_10002': str(fixby),
'fixVersions': fixversion
new_issue = jira_con.create_issue(fields=issue_dict)
----------------
when I run the python script I get the following error:
response text = {"errorMessages":[],"errors":{"fixVersions":"data was not an array"}}
Question is - how can I set the "Fix Version/s" field?
If I remove the "fixVersions: fixversion" line the story is created correctly
Thanks
The API documentation shows the "fixVersions" field expecting a list of dictionaries:
"fixVersions": [ { "id": "10001" } ],
You will almost certainly need to look up the project ID based on the version name to know the ID value(s) that you want to use.
You might try with an array of strings ? and add operation too ?
See the following example: https://community.atlassian.com/t5/Jira-questions/Error-data-was-not-an-array-when-updating-customfield-and/qaq-p/1321407
Nicolas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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! ✍️Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.