You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi,
I tried to update an issue transition and comment with the following POST call, but I kept getting errors. It seems that the issue lies in "transition" but I am not sure how to solve this. I could make GET requests and other POST requests like adding comments fine.
url = '/rest/api/2/issue/{issueIdOrKey}/transitions'
payload = {
"update": {
"comment": [
{
"add": {
"body": "test"
}
}
]
},
"transition": {
"id": "2"
}
}
response = requests.post(url,data=payload, headers=headers)
Error Msg
{"errorMessages":["Unrecognized token 'transition': was expecting 'null', 'true', 'false' or NaN\n at [Source: org.apache.catalina.connector.CoyoteInputStream@558dc7a5; line: 1, column: 12]"]}
If I add json.dumps() to the payload, the error messages changes.
{"errorMessages":["Internal server error"],"errors":{}}
Appreciate your help
have you tried transitioning a different issue or using a different, less restrictive transition to test? have you tried without the comment? Start there if you havent yet to help narrow down what may be the issue.
what language are you using? Python?
That error indicates your payload is not formatted correctly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Randy,
Yes, I am using Python.
There was no error when I tested the payload format with some online JSON viewers, and both parameters - 'update' and 'transition' - are also valid, yet I still couldn't update the issue status. What could possibly be wrong here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use json.dumps . Checkout the example for python in the docs https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issue-issueIdOrKey-transitions-post
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I did try using json.dumps, and I got this "Internal server error".
{"errorMessages":["Internal server error"],"errors":{}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
post your code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I only added json.dumps() to the payload. Here is the code
url = '/rest/api/2/issue/{issueIdOrKey}/transitions'
payload = json.dumps({
"update": {
"comment": [
{
"add": {
"body": "Bug has been fixed."
}
}
]
},
"transition": {
"id": transitionID
}
})
response = requests.post(url,data=payload, headers=headers)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you able to hit the REST API for anything else successfully or is transitioning the first thing you've done so far with the api?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have used the JIRA API for other purpose - getting attachments, adding comments, etc. They are all working fine, except for this updating transitions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI, Have you solved this problem? I have the same error which confuses me whole day, ahhhhhh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi !
I had this error because I was writing a wrong id : the status id instead of the transaction id. To get a valid transaction id, do a get request before ;)
The error message is not very informative due to a bug : https://jira.atlassian.com/browse/JRASERVER-32132.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.