Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Software error PUT API "no single-String constructor/factory method"

Tejas Srikantappa November 8, 2022

I get the below error message when I update the custom field from API. not sure what i am doing wrong, please help!

Error : 
{'errorMessages': ['Can not instantiate value of type [simple type, class com.atlassian.jira.rest.v2.issue.IssueUpdateBean] from JSON String; no single-String constructor/factory method']}

 

Data that i am sending:

{
"update": {
"customfield_25305": [ {"set": [{"value": "c6f1e31ce0138cba658f769accaac729bebc42d6" } ]} ]
}
}

 

2 answers

1 accepted

0 votes
Answer accepted
Tejas Srikantappa November 9, 2022

I was able to resolve the issue, the proper formatting for data is as below:

 

{"fields": {"customfield_25305": "\"1c1a07d49af1b1cde8a1a7bd93cbbeef8efd50c9\", \"c6f1e31ce0138cba658f769accaac729bebc42d6\", \"1c1a07d49af1b1cde8a1a7bd93cbbeef8efd50c9\""}}
0 votes
Prince Nyeche
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 8, 2022

What type of field (field type) are you trying to update? Depending on the field type, there are specific ways the update should occur. 

Tejas Srikantappa November 9, 2022

Thanks for responding @Prince Nyeche , the field type would be string i believe.
when i made get call as per documentation using "/editmeta" i got below.

{'required': False, 'schema': {'type': 'string', 'custom': 'com.atlassian.jira.plugin.system.customfieldtypes:textfield', 'customId': 25305}, 'name': 'Commit ID(s)', 'fieldId': 'customfield_25305', 'operations': ['set']}

 

Suggest an answer

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

Atlassian Community Events