Invalid request payload when i am trying to assign issues - please help

saravanan subramanian
Contributor
December 2, 2024

Hi All,

 

Invalid request payload when i am trying to assign issues in jira cloud using account id- please help

 

 

my $update_data1= '{ "fields": { "assignee": { "accountId": "712020:a9b1948f-5348-4f52-96bd-bc33dff89ead" } } }';

$jira_rest->PUT("https://cmegroup-sandbox-461.atlassian.net/rest/api/2/issue/$issue_key/assignee",$update_data1);

 

 

$VAR1 = '{"errorMessages":["Invalid request payload. Refer to the REST API documentation and try again."]}';

2 answers

1 accepted

3 votes
Answer accepted
Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

Hi @saravanan subramanian 

 

Because you are using the assignation endpoint and not edit endpoint you do not have to specify the field to update.

Payload should be like this

const bodyData = `{ "accountId": "5b10ac8d82e05b22cc7d4ef5" }`;

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-assignee-put

 

Regards

saravanan subramanian
Contributor
December 2, 2024

Thank you very much for the quick turnaround worked very well

1 vote
David Nickell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 2, 2024

You might first double check the account id (or have that person do it for you with the rest MYSELF endpoint).

Otherwise, I don't know the answer but I know where to look.... if you are comfortable with Postman, the libraries are linked on the API document page.  My guess is you can get a clean "body" format there 

docs.jpg

saravanan subramanian
Contributor
December 2, 2024

Thanks for your reply.

 

I was able to use the below

 

Payload should be like this

const bodyData = `{ "accountId": "5b10ac8d82e05b22cc7d4ef5" }`;

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-assignee-put

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events