Error when attempting to update a fixVersion via Jira Rest API Edited

Hey guys, I am currently having issues when trying to update a fix version using the JIRA rest api and Guzzle.

The error I am getting is a 400 with the following message:

{"errorMessages":["Can not deserialize instance of com.atlassian.jira.rest.v2.issue.IssueUpdateBean out of START_ARRAY t (truncated...)

 

The code I am using looks like this:

$aPostData = array(
'update' => array(
'fixVersions' => array(
array(
'set' => array(
array(
'name' => $strTag
)
)
)
)
)
);

$jsonStuff = \GuzzleHttp\json_encode($aPostData);

$response = $cGuzzel->request('PUT',$strJiraAPI, ['headers' => ['Content-Type' => 'application/json'],
'auth' => [JIRA_USER, JIRA_PASS],

'json'=>[$jsonStuff]

]);


Any help would be greatly appreciated!

1 answer

This widget could not be displayed.
Josh Steckler Community Champion Jul 14, 2017

php :)

Can you be more specific about which REST endpoint you are trying to use? Are you updating the fixVersions field of an issue or are you modifying a fixversion on a project?

PUT /rest/api/2/issue/{issueIdOrKey}

or

PUT /rest/api/2/version/{id}

I'm assuming the first. I think the issue is malformed JSON. You have an extra array in there after 'set' => 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

173 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you