Hi Team,
I was doing a little research on how to avoid some unnecessary calls while editing an issue and decided to dig into the “update” options that can be passed in the edit issue body.
You can find some examples for certain fields, but not everything is documented.
The list of operations for each field can be found in edit meta:/rest/api/3/issue/{issueKey}/editmeta
Example for labels:
"labels": {
...
"operations": [
"add",
"set",
"remove"
]
},
I’ve tested all of these operations for Labels and Multi-Select, and they work as expected.
Next, I noticed operations for Attachments and Linked Issues:
"attachment": {
...
"operations": [
"set",
"copy"
]
},
"issuelinks": {
...
"operations": [
"add",
"copy"
]
},
So, I wonder if the “copy” operation could work or if it is a relic of the past (which doesn’t seem to be the case, as it is mentioned in several places in the documentation and is returned by the api).
I tried blindly to find something that might work, e.g.:
"update": {
"attachment": [{"copy": { "from": "WPF-3"}}]
}
However, I always get:
{
"errorMessages": [],
"errors": {
"attachment": "Unrecognized field \"from\" (Class com.atlassian.jira.issue.fields.rest.json.beans.AttachmentsCopyRequestJsonBean), not marked as ignorable\n at [Source: N/A; line: -1, column: -1] (through reference chain: com.atlassian.jira.issue.fields.rest.json.beans.AttachmentsCopyRequestJsonBean[\"to\"])"
}
}
Does anyone know how to get it to work?