Forums

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

Facing an Issue while updating the value of customfield using forge app

Sunilkumar k
Contributor
September 13, 2022

Hi,

 

I am trying to to update the value custom field through forge app by using an api in the way shown below.

 

let newbody2 =
`{
  "fields": {
      "customfield_10033": ${parseInt(formData.newstory)}
      }     
  }`;

console.log("Body created by the issueid is= " + JSON.stringify(newbody2));
    const response2 = await api.asApp().requestJira(route`/rest/api/3/issue/PLUG-1`, {
      method: `PUT`,
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'

     },
      body: newbody2

    });
I am able to update the value in the custom field but throwing an error Saying that "SyntaxError: Unexpected end of JSON input"
Though it is throwing the error  iam able to post the data in custom field.
please help me in resolving this.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events