getTransitions method

Future<Transitions> getTransitions({
  1. required String issueIdOrKey,
  2. String? expand,
  3. String? transitionId,
  4. bool? skipRemoteOnlyCondition,
  5. bool? includeUnavailableTransitions,
  6. bool? sortByOpsBarAndStatus,
})

Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's status.

Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its status, the response will return any empty transitions list.

This operation can be accessed anonymously.

Permissions required: A list or transition is returned only when the user has:

However, if the user does not have the Transition issues project permission the response will not list any transitions.

Implementation

Future<Transitions> getTransitions(
    {required String issueIdOrKey,
    String? expand,
    String? transitionId,
    bool? skipRemoteOnlyCondition,
    bool? includeUnavailableTransitions,
    bool? sortByOpsBarAndStatus}) async {
  return Transitions.fromJson(await _client.send(
    'get',
    'rest/api/3/issue/{issueIdOrKey}/transitions',
    pathParameters: {
      'issueIdOrKey': issueIdOrKey,
    },
    queryParameters: {
      if (expand != null) 'expand': expand,
      if (transitionId != null) 'transitionId': transitionId,
      if (skipRemoteOnlyCondition != null)
        'skipRemoteOnlyCondition': '$skipRemoteOnlyCondition',
      if (includeUnavailableTransitions != null)
        'includeUnavailableTransitions': '$includeUnavailableTransitions',
      if (sortByOpsBarAndStatus != null)
        'sortByOpsBarAndStatus': '$sortByOpsBarAndStatus',
    },
  ));
}