I've seen this problem posted many times, with no clear answer. I'm doing something really simple - updating a text field.
`curl -vvv -D- -u myuser:mypass -X PUT -d '@data.txt' -H "Content-Type: application/json" http://myJIRAinstance/rest/api/2/issue/ProjectNumer-100`
My data.txt looks like this:
{
"fields" : {
"customfield_15801" :
{"value" : "Test"}
}
}
`"name":"Row Name","operations":["set"]},"customfield_15801":{"required":false,"schema":{"type":"string","custom":"com.atlassian.jira.plugin.system.customfieldtypes:textarea","customId":15801},`
I have tried changing all sorts of things - single quotes to double, sending as a string and not JSON (no error results from that, but the Issue is not updated either), tried sending the data not in a file - all sorts of things. This custom field does have "Set" allowed. I've followed the documentation exactly.
There are a handful of other things I'm trying to do, very simple things. Attach a text file to an Issue. Get the list of all Issues in a Project. Everything is failing, so I'm wondering if there's some bigger issue??
JIRA version is 7.8
The docs are wrong. This is the format that worked for a simple text-based field:
curl -D- -u user:'pass' -X PUT -d '@data.txt' -H "Content-Type: application/json" http://jiraServer:8080/rest/api/2/issue/ISSUE-100
cat data.txt
{
"fields" : {
"customfield_15801": "TEST"
}
}
this is true for jira automations as well, using "edit issue" action and "Additional fields"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also if you're trying to DELETE files, you have to get the ID first. Here is a one-liner I made to get the IDs for an issue
curl -s -u user:'pass' -X GET -H "X-Atlassian-Token: no-check" http://jiraServer:8080/rest/api/2/issue/ISSUE-100?fields=attachment | egrep -o "attachment/*[0-9]*" | sort -u | sed '1d' | sed s'&attachment/&&'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.