Plymouth223
Plymouth223

Reputation: 1925

JIRA REST API issue transitions and worklog (v4.4.1)

Is it possible to update the worklog for an issue when transitioning (i.e. POST to /rest/api/latest/issue/{issueid}/transitions) via the REST API for JIRA (API version is 2.0.alpha1 of JIRA v4.4.1)? I'm posting a worklog as part of the request and looking for the minimum information I need to send (currently just minutesSpent and started time as these seem to be the only mandatory ones via the UI).

i.e.

worklog:
{
    name: "worklog",
    type: "worklog",
    value: [
    {
        started: "2012-10-01T10:28:00.000+1000",
        minutesSpent: 480
    }
    ]
},

Currently the post to the URL seems to just ignore this additional data although the transition does take effect with a desired 204 response.

Upvotes: 1

Views: 2233

Answers (1)

gopherr
gopherr

Reputation: 733

From the JIRA REST API Docs:

The fields that can be set on transtion, in either the fields parameter or the update parameter can be determined using the /rest/api/2/issue/{issueIdOrKey}/transitions?expand=transitions.fields resource. If a field is not configured to appear on the transition screen, then it will not be in the transition metadata, and a field validation error will occur if it is submitted.

If, in the response you get from the expansion, you don't see worklog, then I don't think it is possible.

Upvotes: 2

Related Questions