Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira API - Set Assignee and Apply Transition in 1 Call

Sidharth David
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 15, 2021

Is it possible to set an assignee and apply a transition (change status) in a single call to the Jira Cloud REST API? The example from the documentation here seems to imply that you can, but it does not work when I tested it.

Here's some examples (with curl): Site

setting an assignee works

curl --request PUT \
    --url "https://mysite.atlassian.net/rest/api/2/issue/project-123" \
    --user "johnsmith@example.com:abcdef1234567890abcdef00" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data '{
        "fields": {
            "assignee": { "accountId": "987654321fedcba987654321" }
        }
    }'

applying a transition works too

curl --request POST \
    --url "https://mysite.atlassian.net/rest/api/2/issue/project-123/transitions" \
    --user "johnsmith@example.com:abcdef1234567890abcdef00" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data '{
        "transition": { "id": 1 }
    }'

error saying that assignee cannot be set 

curl --request POST \
    --url "https://mysite.atlassian.net/rest/api/2/issue/project-123/transitions" \
    --user "johnsmith@example.com:abcdef1234567890abcdef00" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data '{
        "fields": {
            "assignee": {
                "accountId": "987654321fedcba987654321"
            }
        },
        "transition": {
            "id": 1
        }
    }'

sets assignee, but doesn't apply transition

curl --request PUT \
    --url "https://mysite.atlassian.net/rest/api/2/issue/project-123" \
    --user "johnsmith@example.com:abcdef1234567890abcdef00" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data '{
        "fields": {
            "assignee": {
                "accountId": "987654321fedcba987654321"
            }
        },
        "transition": {
            "id": 1
        }
    }'

  

1 answer

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
August 15, 2021

Hi @Sidharth David welcome on the community.

I just tested your case and I found the cause of your problem.

You need to create Transition screen and assign it to the transition. This screen must at least has Assignee field confiured.

  1. create screen
    1. "." -> Screens -> Add Screen
    2. Edit screen
    3. add Assignee field
  2. adjust workflow
    1. "." -> Workflows
    2. "Edit" on your workflow
    3. Open your transition (column Transitions (id))
    4. Edit -> Transition View (select created screen) -> Update
    5. publish your workflow

It should work...

Suggest an answer

Log in or Sign up to answer