I am trying to drag and drop an issue (Transition it) on a Kanban board; I am using the REST API, but the action does not affect the status on the board.
This is my code (python function):
def get_ticket(issueID,state):
'''
Transition ticket into the next status
'''
server = url + "rest/api/2/issue/" + issueID +'/transitions?expand=transitions.fields&transitionId=' + str(state)
headers = {
"Accept": "application/json",
"Content-Type": "application/json"}
payload = json.dumps( {"transition": {"id": state} })
response = requests.request(
"POST",
url,
data=payload,
headers=headers,
auth=HTTPBasicAuth(user, apikey)
)
print("Status: ",response.status_code)
return(response)
I have checked the valid transition states and got this (hiding some information for privacy reasons):
{'expand': 'transitions',
'transitions': [{'id': '51',
'name': '<test label>',
'to': {'self': 'https://<server/rest/api/2/status/10158',
'description': '',
'iconUrl': 'https://<server>/images/icons/statuses/generic.png',
'name': '<test label2>',
'id': '10158',
'statusCategory': {'self': 'https://<server>/rest/api/2/statuscategory/2',
'id': 2,
'key': 'new',
'colorName': 'blue-gray',
'name': 'To Do'}},
'hasScreen': False,
'isGlobal': False,
'isInitial': False,
'isAvailable': True,
'isConditional': True,
'fields': {},
'isLooped': False}]}I have tried to use the next state as '51' or '10158' or '2', both as digit and as text; also, I have tried the address with and without the transitionId attached at the end, but the transaction does seem to have any effect, and none of them get any errors.
Any guidance over what I might be missing is appreciated.