Skip to end of metadata
Go to start of metadata

Applicable:

JIRA 5.0 and later.

 

The Rest API allows you to edit an issue.

The JIRA REST api is very flexible in how it allows you to edit an issue. You can PUT a document, an updated version of the issue you received with a GET request, or you can send commands to set or modify fields of an issue.

Icon

The examples shown here use curl with an input file denoted by the "--data @filename" syntax and the file data is shown separately

Field meta-data

The editable fields and the operations they support can be obtained using the "editmeta" resource, e.g.

Examples of updating an issue using fields.

Example of assigning an issue to user "harry"

This simple edit

Request

example input data

Response

You should just receive a response with a status of "204 No Content"

Example of updating many fields at the same time

Here we update the assignee and also the due date, two custom fields and the summary.

This simple edit

Request

example input data

Response

You should just receive a response with a status of "204 No Content"

Examples of updating a field using operations.

The issues of a field may also be updated in more flexible ways using the SET, ADD and REMOVE operations. Not all fields support all operations, but as a general rule single value fields support SET, whereas multi-value fields support SET, ADD and REMOVE, where SET replaces the field contents while ADD and REMOVE add or remove one or more values from the the current list of values.

Adding a component

Request

example input data

Response

You should just receive a response with a status of "204 No Content"

Setting the components field

Request

example input data

Response

You should just receive a response with a status of "204 No Content"

Adding a component and removing another

Request

example input data

Note: The "Engine" component (if it exists) remains unaffected by this update.

Response

You should just receive a response with a status of "204 No Content"

Manipulating multiple fields

Request

example input data

Response

You should just receive a response with a status of "204 No Content"

  • No labels

3 Comments

  1. Anonymous

    Anyone know what's wrong with this?

    var url = '/path/to/jira/';
    var data = {
    fields: {
    duedate: '2013-10-22'
    }
    };
    $.ajax({
    url: url,
    type: 'PUT',
    contentType: 'application/json',
    data: data,
    success: function(data){ console.log(data) }
    });
    1. Anonymous

      I'm getting a 400 response, with error:

      {"errorMessages":["Unrecognized token 'fils5deae5': was expecting 'null', 'true', 'false' or NaN\n at [Source: org.apache.catalina.connector.CoyoteInputStream@5006db0d; line: 1, column: 21]"]}

      (I'm logged in to our JIRA instance.)

      1. Anonymous

        Had to run JSON.stringify(data) when I PUT...