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

JacobParis July 22, 2021

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: 'https://<project>.atlassian.net/rest/api/3/issue/14374/transitions ',
  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

0 votes
Answer accepted
David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2021

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.

JacobParis July 22, 2021

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
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events