Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

REST API Transition issue via POST returns 404, listing transitions via GET is successful

I am trying to use the REST API to transition an issue from one status to another.

Doing a POST request `/rest/api/3/issue/12345/transitions` is returning a 404

The documentation for the transition method explains that a 404 is "returned if the issue is not found or the user does not have permission to view it."

Doing a GET request (`/rest/api/3/issue/12345/transitions`) successfully returns the available transitions (with their IDs). It is one of these IDs I've passed into the body of my POST request, so I know that is correct. It's the same issue ID I'm using for both POST and GET requests, so I know that is correct, and since it's successfully returned by the GET request I feel that strongly implies my user has the permission to view it. 

I'm using Basic authentication with my email and token. As a logged in user, I have no problem viewing, creating, deleting, and transitioning issues. The results don't change based on whether I am attempting to transition an issue someone else in my organization created or one that I created myself – it's a 404 either way.

Attempting to query the issue by key `/rest/api/3/issue/ABC-1234/transitions` returns an identical 404 error

Using rest api version 2 instead of 3 returns an identical 404 error

The request configuration object is below (token obfuscated)

config: {
  url: '',
  method: 'post',
  data: '{"headers":{"Authorization":"Basic 123123123123123123bmNlLm123123123123JEZEwzR123123123123123="},"transition":{"id":"531"}}',
headers: {
  Accept: 'application/json, text/plain, */*',
  'Content-Type': 'application/json;charset=utf-8',
  'User-Agent': 'axios/0.21.1',
  'Content-Length': 134

Is it possible my user token is missing write-scopes that are available to my logged in user? The docs imply that would result in a 401 instead, but I am running out of ideas.

1 answer

1 accepted

Hello @JacobParis 

Have you tried testing your method and authorization credentials with a REST test tool like Postman first? That would at least isolate the problem either faulty method vs faulty code.

I don't know how to form requests in Axios, but your example looks a bit weird. It has a body statement that contains a 'headers' definition which contains authorization data, but further down there is another headers statement that contains the header definitions... that is where the authorization data should be. It looks like you're putting the authorization data in the wrong part of the request.

You're right, that was the issue. The positional arguments between GET and POST are a bit different and I overlooked that. This is working as expected now; thank you

Suggest an answer

Log in or Sign up to answer
Site Admin
Community showcase
Published in Trello

🏊‍♀️ Atlympic Event: Trello

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

124 views 1 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you