@kkercz I have now changed the code to add the issue first and then update it. The add works fine, the update fails with OAuth 2.0 is not enabled for method: PUT /rest/api/2/issue10045. Here’s my code:
// insert the issue var body_data = <some structure that works>; var response = await api.asApp().requestJira(route`/rest/api/3/issue`, { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: body_data }); var t1 = await response.json(); // this works, issue is created OK // update the just-created issue with the value var custom_field_identifier = stored_info.custom_field_info.schema.custom; var bodyData = '{ "fields": { "' + custom_field_identifier + '": "' + api_body.column_value + '" } }'; var r1d1 = await api.asApp().requestJira(route`/rest/api/2/issue${t1.id}`, { method: 'PUT', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: bodyData }); var t2 = await r1d1.json();
The stored-info structure is just something I save when the app is installed, to use later.
And here’s the manifest, for the custom field:
jira:customField:
- key: my_external_id
name: My External ID
description: The external ID for this Issue
type: string
I’ve tried this with two different formats of the field key, one you’ve suggested here and the one shown here. Both give me the same error - the OAUTH 2.0 thing.
What am I doing wrong? Please help!