When creating a issue from API receiving error Number value expected as the Sprint id

Muhammad Ramzan_Atlassian Certified Master_
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.
November 17, 2019

When i am creating issue from the Rest API by providing the spring number, its throwing error 

 

{"errorMessages": [  "Number value expected as the Sprint id."],"errors": {}}

 

{
"fields": {
"project": {"key": "EAP"},
"summary": "bug",
"issuetype": {"name": "Bug"},
"assignee": {"name": "muh"},
"reporter": {"name": "muh"},
"priority": {"name": "Blocker"},
"customfield_11824": {"value": "test2"},
"customfield_10004": {"value": 1851}
}
}

1 answer

1 accepted

3 votes
Answer accepted
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 17, 2019

Hello @Muhammad Ramzan_Atlassian Certified Master_,

is 10004 ID of your Sprint custom field?

If so, please, try to replace 

"customfield_10004": {"value": 1851}

with

"customfield_10004": 1851

It is not clear, what do you store to the second custom field with ID 11824, but probably you will have to fix it either.

Muhammad Ramzan_Atlassian Certified Master_
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.
November 18, 2019

Thanks it works, other fields are custom fields they are working with the same code

Rikin Patel May 29, 2020

Thanks a lot its working for me... 

and if you want to use Sprint instead of customfield then also you can use it.

 

e.g."Sprint": 4160

Santhosh Kumar Arogyaswamy July 14, 2023

Thanks the below statement worked for Sprint update.

issue.update(notify=False,fields={'customfield_11990':5314})

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events