restjirajira-rest-apijira-rest-java-api

How to update custom field in JIRA via REST API?


This (resolution description) custom filed should be updated while the "resolution" changed to "fixed" so I used the "transition" REST API call to do it.i have passes the following jason string via REST API call.but no sign of working as expected. can't I change those two fields with "transition" REST API call?

{"update": {"resolution description": [{ "add": { "body": "" + errors + "" }}]},
"transition": { "id": "5" }}

"errors" is a variable with hard-coded value.


Solution

  • I have found the answer for this question.I also put this question in here. To update a custom field using REST API you can basically write a JSON string like this. For more information follow this link and this site clearly include everything need to know when going to access JIRA custom fields by REST API.

    {
        "fields": {
            "customfield_id": {"This is a shorthand for a set operation on a text custom field"},
            "resolution": {"name": "Fixed"}
        },
        "transition": {
            "id": "5"
        }
    }