Field value update using api in Jira forge

Hi Everyone,

I have created small forge app to do some calculation and update read only field type(similar to attachment counter app by Atlassian)

which was working find in Dev environment but it failed to store value on field in production environment. I checked the logs that execution goes to store function and even formatted bodydata too

I tried to get the status of response using conole.log but gets no response. below is my store function snippet. kindly suggest what would be the reason for failure in prod envrionment

export async function setValue({fieldKey, issueId, value}) {
                      const url = route`/rest/api/2/app/field/${fieldKey}/value`;
                      let bodyData = `{
                            "updates": [
                                 {
                                    "issueIds": [ ${issueId} ],
                                    "value": "${value}"
                                 }
                            ]
                      }`;
                      console.log(bodyData);
                const response = await api.asApp().requestJira(url, {
                method: 'PUT',
                headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json'
                },
                body: JSON.stringify(bodyData)
                });
                console.log(await response.status, await response.statusText);
                }

Thanks in advance,
Leo

Hi @LeoPrakash1. Welcome to the developer community.

First, I suggest checking that your latest code is deployed to prod. Can you run forge environments list and verify that you’ve deployed the most recent version of your code to the production environment? If prod isn’t up to date, try using forge deploy -e production.

Hi @nmansilla , thank you for taking look on this thread
I did confirm that the version and environment. I added extra logging parameters in below manner

  1. On field type function
    1.1 console.log(some string and value)
    1.2 calling setvalue function
  2. On Set value function
    2.1 console.log(bodydata with value formatted before rest call)
    2.2 Calling rest api to set field value
    2.3 console.log(rest call status)

in this function I get log till 2.1 and there is no log which says rest call succeeded or failed
Could you please suggest what I would be missing as my function is async

Thanks in advance,
Leo